static void RunOnce() { UnityEvents instantiate = Instance; Instance.OnProjectLoad(); EditorApplication.update -= RunOnce; }
void Start() { UnityEvents uv = UnityEvents.Instance; uv.pauseListeners = new List <Component>(); uv.resumeListeners = new List <Component>(); uv.playListeners = new List <Component>(); uv.stopListeners = new List <Component>(); uv.saveSceneListeners = new List <Component>(); uv.loadProjectListeners = new List <Component>(); if (!uv.playListeners.Contains(this)) { uv.addEventListener(this, uv.playListeners); uv.addEventListener(this, uv.stopListeners); uv.addEventListener(this, uv.pauseListeners); uv.addEventListener(this, uv.saveSceneListeners); uv.addEventListener(this, uv.loadProjectListeners); } }