Beispiel #1
0
 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);
     }
 }
Beispiel #4
0
    //public int sampleMetric1, sampleMetric2;

    void Awake()
    {
        if (_metricsInstance == null)
        {
            _metricsInstance = this;
        }
        else if (_metricsInstance != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(this);
    }
Beispiel #5
0
 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);
     }
 }