Пример #1
0
    public void TransferToMatchScene()
    {
        if (PhotonNetwork.IsMasterClient == false)
        {
            Debug.LogError("A non-master tried to move directly to match - ignoring");
            return;
        }
        else if (ArePlayersConnected() == false)
        {
            Debug.LogError("Tried to move to directly to match when not all characters are connected");
            return;
        }
        else if (NetworkMatchSetup.HasAllMatchSetupInfo() == false)
        {
            Debug.LogError("MatchSetup is not filled out enough to start a match");
            return;
        }

        if (SceneManager.GetActiveScene().name == "_MATCH")
        {
            Debug.Log("We're already in the _MATCH scene, so no need to transfer to it");
        }
        else
        {
            Debug.Log(NetworkMatchSetup.MatchSetupToString());
            Debug.Log("We as the master are moving us to the Match scene");
            PhotonNetwork.LoadLevel("_MATCH");
        }
    }