Beispiel #1
0
        private void OnEnable()
        {
            runners = new List <IScriptRunner> ();

            Game.OnGameStateChange  += HandleGameStateChangeEvent;
            Game.OnEventCallDelayed += HandleEventPropagationDelayed;
            Game.OnEventCall        += HandleEventPropagation;
            Game.OnEventCallData    += HandleEventPropagation;

            ScriptableWorker.Register(RunScripts);
        }
Beispiel #2
0
        private void OnDisable()
        {
#if UNITY_EDITOR
            if (!UnityEditor.EditorApplication.isPlaying)
            {
                return;
            }
#endif

            ScriptableWorker.Unregister(RunScripts);

            Game.OnGameStateChange  -= HandleGameStateChangeEvent;
            Game.OnEventCall        -= HandleEventPropagation;
            Game.OnEventCallData    -= HandleEventPropagation;
            Game.OnEventCallDelayed -= HandleEventPropagationDelayed;
        }
Beispiel #3
0
 private void HandleEventPropagationDelayed(string eventName, float delay)
 {
     ScriptableWorker.RunCoroutine(PropagateEventDelayed(eventName, delay));
 }
 /// <summary>
 /// Despawns the cloned gameobject with a delay
 /// </summary>
 /// <param name="obj">The object to despawn</param>
 /// <param name="delay">How long should the despawn wait?</param>
 public void PutBack(GameObject obj, float delay)
 {
     ScriptableWorker.RunCoroutine(DelayPutBack(obj, delay));
 }
Beispiel #5
0
 private void Awake()
 {
     Instance = this;
 }