Exemple #1
0
 void OnDisable()
 {
     if (DontDestroy && Instance == this)
     {
         Instance = null;
     }
 }
 void Awake()
 {
     if (Instance != null)
     {
         DestroyImmediate(this.gameObject);
         return;
     }
     if (DontDestroy)
     {
         Instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
Exemple #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;
            }
        }