void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject.transform);
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 2
0
    public void IsSingleToggle()
    {
        PhotonNetManager manager = PhotonNetManager.instance;

        if (singleToggle.isOn)
        {
            manager.singlePeople      = true;
            manager.MaxPlayersPerRoom = 1;
            manager.GoGameNumber      = 1;
        }
        else
        {
            manager.singlePeople      = false;
            manager.MaxPlayersPerRoom = 2;
            manager.GoGameNumber      = 2;
        }
    }
Exemplo n.º 3
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        PhotonNetwork.automaticallySyncScene = true;
        PhotonNetwork.logLevel = Loglevel;

        DontDestroyOnLoad(gameObject);

        if (matchBtn_obj != null)
        {
            _matchTxt = matchBtn_obj.transform.Find("matchTxt").GetComponent <Text>();
            _matchBtn = matchBtn_obj.GetComponent <Button>();
        }
    }