Exemple #1
0
 void OnDisable()
 {
     if (instance == this)
     {
         instance = null;
     }
 }
Exemple #2
0
 void OnDestroy()
 {
     if (instance == this)
     {
         instance = null;
     }
 }
Exemple #3
0
        void OnEnable()
        {
            if (instance != null && instance != this)
            {
                MonoBehaviour.Destroy(this);
                Debug.LogError("Only one instance of VoiceChatRecorder can exist");
                return;
            }

            Application.RequestUserAuthorization(UserAuthorization.Microphone);
            instance = this;
        }