Exemplo n.º 1
0
    private void Awake()
    {
        if (PhotonRoomCustomMatch.room == null)
        {
            PhotonRoomCustomMatch.room = this;
        }
        else
        {
            if (PhotonRoomCustomMatch.room != this)
            {
                Destroy(PhotonRoomCustomMatch.room.gameObject);
                PhotonRoomCustomMatch.room = this;
            }
        }

        DontDestroyOnLoad(this.gameObject);
    }
Exemplo n.º 2
0
 private void Awake()
 {
     //set up singleton
     if (PhotonRoomCustomMatch.room == null)
     {
         PhotonRoomCustomMatch.room = this;
     }
     else
     {
         if (PhotonRoomCustomMatch.room != this)
         {
             Object.Destroy(PhotonRoomCustomMatch.room);
             // Destroy(PhotonRoom.room.gameObject);
             PhotonRoomCustomMatch.room = this;
         }
     }
     DontDestroyOnLoad(this.gameObject);
 }