- Home /
[Editor Scripting] Call Function in other GameObjects Editor Script?
I am scripting in an editor script, both GameObjects A and B have the script.
In the Editor Script, I have created gameobject B (from A) by using : GameObject objB = null; (it's populated later)
Now, I want to call a function on GameObjectB's EDITOR SCRIPT. How can I do this?
If I call the function directly: myFunction(); ... then it would be run on Gameobject A.
So I'm trying to do something like: objB.getEditorScript().myFunction();
Any tips?
I think you should just move your function from objB's editorScript to objB's mainScript. and if you are using some variables or classes that are only available in editor Script you can simply add parameter to your function and pass those values.
Your answer
Follow this Question
Related Questions
How to access Custom Inspector own gameObject 1 Answer
Transition Viewable Variables in Custom Inspector 0 Answers
How to create instance from model without creating a clone? 2 Answers
Why is my propertydrawer being automatically disabled? 1 Answer
Function being called on multiple objects when just one is clicked 1 Answer