Ejemplo n.º 1
0
 private void Awake()
 {
     if (_SoundManager.instance == null)
     {
         _SoundManager.instance = this;
     }
     else if (_SoundManager.instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
         //DontDestroyOnLoad(this);
     }
 }
Ejemplo n.º 3
0
 void Singleton()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     else
     if (_instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }