I have a code in cutom editor and this code needs to be active if unity is running. For example.
Camera.main.SendMessage("iListen",viewPos);
When unity is not running it spits out an error “!IsPlayingOrAllowExecuteInEditMode ()”
This is why I need to add an if code; should look something like this -
if (UnityIsPlaying) Camera.main.SendMessage("iListen",viewPos); // P.S. this is an example and does not work.