Exemplo n.º 1
0
 static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
 {
     // Make sure we empty all our static references every time the new scene is loaded.
     AnimatedProps         = null;
     CheckpointService     = null;
     NullCheckpointService = null;
     CoinCointer           = null;
     NullCoinCounter       = null;
     VoiceoverService      = null;
     NullVoiceoverService  = null;
     AllLocations          = null;
     LoadTruck             = null;
     ControllerService     = null;
     UnloadTruck           = null;
     QuaryUpgradable       = null;
     DisplayController     = null;
 }
Exemplo n.º 2
0
        public static void UnsubscribeFromQuaryUpgradedEvent(QuaryUpgradedEventHandler handler)
        {
            if (QuaryUpgradable == null)
            {
                QuaryUpgradable = GameObject.FindObjectOfType <QuaryUpgradable>();
#if UNITY_EDITOR
                if (QuaryUpgradable == null && !HideWarnings)
                {
                    Debug.LogError("No '" + nameof(GreenPandaAssets.Scripts.Other.QuaryUpgradable) + "' component present in the scene!");
                }
#endif
            }

            if (QuaryUpgradable != null)
            {
                QuaryUpgradable.UnsubscribeFromQuaryUpgradedEvent(handler);
            }
        }