コード例 #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;
            }
        }