- Home /
How do I override objects that aren't in the Hierarchy?
How do I override Unity objects that aren't available in the Hierarchy?
I'm an experienced programmer, but new to Unity (or any developer similar platform), so I know how to write override scripts. But I'm not sure what to attach them to if the object I want to override isn't available in the Hierarchy create menu. There doesn't seem to be any way to get these scripts to run... but I know that's not the case because tons of online tutorials discuss overriding these objects... they show the scripts, but they all neglect to show the next step of where attach the script.
The two objects that I'm focused on are Tilebase and ITilemap. Neither of these objects can be added as a GameObject or component... so what do I attach the override script to if I want to override their behavior? Confused.
Thanks for any help.
So for a script to be added to the scene, it has to inherit from $$anonymous$$onoBehaviour. The TileBase class inherits from the ScriptableObject class. That is where your problem is I think. For the rest I have no idea what TileBase even is, but I suggest checking out this page : https://answers.unity.com/questions/237057/scriptableobject-method-overloading.html . It says overloading but its about overriding. As you are an experienced programmer, you can probably go further from there.
Your answer
Follow this Question
Related Questions
An OS design issue: File types associated with their appropriate programs 1 Answer
Inherited class, trying to overwrite variable. 0 Answers
[Solved] Base Update Function? Does It Use Overriden Methods? 1 Answer
Quick Question About Overriding in C# 1 Answer
Practical differences between overriding and shadowing Start(), Update()... 2 Answers