Ejemplo 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;
 }
Ejemplo n.º 2
0
 public static ICheckpointDispatcher GetCheckpointService()
 {
     if (CheckpointService != null)
     {
         return(CheckpointService);
     }
     else
     {
         var service = GameObject.FindObjectOfType <CheckpointService>();
         if (service != null)
         {
             CheckpointService = service;
             return(CheckpointService);
         }
         else
         {
             if (NullCheckpointService == null)
             {
                 NullCheckpointService = new NullCheckpointService();
             }
             return(NullCheckpointService);
         }
     }
 }