Exemplo n.º 1
0
        void OnDestroy()
        {
            if (_Instance == this)
            {
                _Instance = null;
            }

            if (LogApplicationMessage)
            {
                Application.logMessageReceived -= Application_logMessageReceived;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Awake
 /// </summary>
 void Awake()
 {
     if (_Instance != null)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _Instance = this;
         DontDestroyOnLoad(this.gameObject);
         if (LogApplicationMessage)
         {
             Application.logMessageReceived += Application_logMessageReceived;
         }
     }
 }