- Home /
Access Monobehavior Instance from Static Function of Editor Script
I have tried a few different ways so far but nothing has worked. Not entirely sure if this is possible at all. Specifically I am trying to use CoRoutines from inside of a static function of an Editor Script.
Answer by Bunny83 · Jun 16, 2011 at 06:37 PM
Coroutines work ONLY at runtime. The coroutine scheduler is not running in the editor.
What you can do is using your own coroutines but they work a bit different. You would use the Update function or the update delegate to drive your scheduler.
If you talk about runtime you can access scripts on GameObjects like always: Use either FindObjectOfType, GameObject.Find and use GetComponent
Your answer
Follow this Question
Related Questions
Updating object on inspector value changes in editor 1 Answer
How to get notification of moving a GameObject in the hierachy when editing the scene? 1 Answer
How to check if a key is down in editor script 2 Answers
Are there any autosave scripts out there to protect against losing too much work? 4 Answers
Any way to invisibly tag an object? 1 Answer