コード例 #1
0
 protected virtual void OnDestroy()
 {
     if (sInstance == this)
     {
         sInstance = null;
     }
 }
コード例 #2
0
 /// <summary>
 /// Base awake method that sets the singleton's unique instance.
 /// </summary>
 protected virtual void Awake()
 {
     if (sInstance != null)
     {
         Debug.LogError("Trying to instantiate a second instance of PlacenoteMultiplayerManager singleton ");
     }
     else
     {
         sInstance = this;
         PhotonNetwork.autoJoinLobby          = true;
         PhotonNetwork.automaticallySyncScene = false;
         mPhotonView = sInstance.GetComponent <PhotonView> ();
     }
 }