Esempio n. 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);
     instance = this;
     Logger.log?.Debug($"{name}: Awake()");
 }
Esempio n. 2
0
 private void OnDestroy()
 {
     Logger.log?.Debug($"{name}: OnDestroy()");
     GameObject.Destroy(BetterFPFC.instance);
     instance = null;
 }