Example #1
0
 private void Awake()
 {
     if (m_instance == null)
     {
         m_instance = this;
         DontDestroyOnLoad(m_instance);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
    void Awake()
    {
        DontDestroyOnLoad(this);

        if (_audioInstance == null)
        {
            _audioInstance = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }