#Draggable child class
1 messages ยท Page 1 of 1 (latest)
i might've just worded it wrong
the idea was to have my own kind of MonoBehaviour style script thats just for writing out the cinematic events in c#
SO doesn't seem to fit that function
good for setting up like stats and other simple behaviors that only need parameters but i'm trying to make a simplified event builder essentially thas all
for the actors i have to have a predefined dictionary with an ID and game object reference on an actual monobehaviour
probably could just do something like that
for the "custom scripts"
So the events could be unique? I can see why SO doesn't work then (at least like this). You could make the SO's sub assets and have unique data on them but sounds like a hassle
well, the cinematic action is already basically part of the workflow
Anyway the first thing I recommended (using SerializeReference) should work here
SerializeReference allows you to serialize child classes derived from an abstract class or interface
oh lemme try that
SerializeReference fields don't show up in the inspector by default tho - so you'd need a solution like the one I linked before https://github.com/vertxxyz/Vertx.SerializeReferenceDropdown
ok ill bookmark that for now. i think an ID table is good enough for the application for now but i'll go back over this for future expansion
appreciate the link
oh hey
dropping the field type to UnityEngine.object allowed it
would i be able to recast it to my class type? (i'll find out in a minute but save me that much time?)
interesting
Is Script a MonoScript? As I mentioned earlier, that doesnt work at runtime.
doesn't like casting back to CinematicScript
Things dont work this way
but is there a runtime emit here?
MonoScript isn't an object with functionality
or some way to runtime compile code?
There might be some frameworks for that, but why?
Do you want people to be able to code at runtime?
its more for advanced event sequencing
yeah idk about this. emitting is usually not a great idea anyway
meh
Idk why you need to do any emitting/reflection here if the class always already exists at editor time anyway
yeah this is all way more convoluted than it needs to be. oh well
easier to just drop monos into an ID table on a scene director object and run those by key
thanks for the insight either way ๐
I assumed that you want to expose some fields of the classes so you can give them unique values here
If not, then sure
oh yeah so this did the trick: https://assetstore.unity.com/packages/tools/utilities/serialize-reference-editor-297559