Beispiel #1
0
 private void Awake()
 {
     if (instance != null)
     {
         Logger.log?.Warn($"Instance of {this.GetType().Name} already exists, destroying.");
         GameObject.DestroyImmediate(this);
         return;
     }
     GameObject.DontDestroyOnLoad(this); // Don't destroy this object on scene changes
     instance = this;
     Logger.log?.Debug($"{name}: Awake()");
 }
Beispiel #2
0
 public void OnMenuSceneLoadedFresh(ScenesTransitionSetupDataSO transitionSetupDataSO)
 {
     PP_HelperController.OnLoad();
     if (!RawPPLoader.IsInit())
     {
         RawPPLoader.Initialize();
     }
     PPUtils.Initialize();
     ProfileDataLoader.instance.Initialize();
     AccLoader.instance.Initialize();
     if (Config.playHistory)
     {
         PlayHistoryTracker.Initialize();
     }
 }
Beispiel #3
0
 private void OnDestroy()
 {
     Logger.log?.Debug($"{name}: OnDestroy()");
     instance = null; // This MonoBehaviour is being destroyed, so set the static instance property to null.
 }