private void OnDestroy() { if (instance == this) { instance = null; } }
void Awake() { if (metrics == null) { DontDestroyOnLoad (gameObject); metrics = this; } else if (metrics != this){ Destroy(gameObject); } }
void Awake() { Debug.Log ("I fired"); if (metrics == null) { DontDestroyOnLoad (gameObject); metrics = this; } else if (metrics != this){ Destroy(gameObject); } }
//public int sampleMetric1, sampleMetric2; void Awake() { if (_metricsInstance == null) { _metricsInstance = this; } else if (_metricsInstance != this) { Destroy(gameObject); } DontDestroyOnLoad(this); }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(instance.gameObject); } else { Destroy(this); } }
void Awake() { Debug.Log("I fired"); if (metrics == null) { DontDestroyOnLoad(gameObject); metrics = this; } else if (metrics != this) { Destroy(gameObject); } }