Esempio n. 1
0
 public void OnDisable()
 {
     if (instance == this)
     {
         instance = null;
     }
 }
Esempio n. 2
0
        public void Awake()
        {
            DontDestroyOnLoad(gameObject);

            if (instance)
            {
                Destroy(instance.gameObject);
            }
            instance = this;
        }