- Home /
Make object to change state in Editor
I have objects in scene that can take different states and are switching their appearance depending on its current state (for example, show or hide a flag).
State can be changed manually in editor as well as at runtime. When state changed at runtime, then actions are taking place to change appearance .
In Editor, of course, scripts are not running.
Is it possible to script an object such way that it will execute some actions at 'editor time' to change appearance depending on manually selected state?
Answer by robertbu · Dec 18, 2013 at 11:59 PM
You can do what you want with ExecuteInEditMode.
http://docs.unity3d.com/Documentation/ScriptReference/ExecuteInEditMode.html
Oh, that simple. :) I've searched some queries that look alike, but probably have not formulated it right. As they say, the right question itself contains the answer.
Your answer
