Пример #1
0
 void OnDisable()
 {
     if (DontDestroy && Instance == this)
     {
         Instance = null;
     }
 }
Пример #2
0
 void Awake()
 {
     if (Instance != null)
     {
         DestroyImmediate(this.gameObject);
         return;
     }
     if (DontDestroy)
     {
         Instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
Пример #3
0
        void Awake()
        {
            if (Instance != null)
            {
                DestroyImmediate(this.gameObject);
                return;
            }
            if (DontDestroy)
            {
                Instance = this;
                DontDestroyOnLoad(this.gameObject);
            }

            if (EventsIn)
            {
                PhotonNetwork.NetworkingClient.LoadBalancingPeer.TrafficStatsEnabled = true;
            }
        }