- Home /
Question by
johnknaack · Nov 28, 2011 at 09:36 PM ·
editorrunningplaying
Is Running/Playing flag?
Is there a IsRunning or IsPlaying type flag to determine if you are in play mode or in the editor?
Comment
Best Answer
Answer by Eric5h5 · Nov 28, 2011 at 10:22 PM
Application.isPlaying. Just as a note, the scripting docs do have a search function.
Answer by Bunny83 · Nov 28, 2011 at 10:27 PM
Did you even look into the documentation? It's a mystery how you missed that.
ps. keep in mind that all this stuff belongs to the editor namespace. If you use it in normal game script you can't build your game. Make sure to surround all editor functions with
#if UNITY_EDITOR
// editor stuff
#endif
if you want to use editor functions inside a game script.
For more information see: Conditional compilation