Ejemplo 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;
 }
Ejemplo n.º 2
0
 private void OnDestroy() => Instance = null;