Пример #1
0
    private void StartMatch()
    {
        // If multiplayer game and opponent is readied, start game
        Networker networker = GameObject.FindObjectOfType <Networker>();

        if (networker != null && networker.clientIsReady && networker.isHost)
        {
            networker.HostMatch();
        }
        // If networker is null, we should load into an AI match with whatever AI settings the player set
        else if (networker == null)
        {
            lobby.LoadAIGame();
        }
    }
Пример #2
0
    private void Awake()
    {
        HideButton();

        button.onClick.AddListener(() =>
        {
            Networker networker = GameObject.FindObjectOfType <Networker>();
            if (networker != null && networker.clientIsReady && networker.isHost)
            {
                networker.HostMatch();
            }
            // If networker is null, we should load into an AI match with whatever AI settings the player set
            else if (networker == null)
            {
                lobby.LoadAIGame();
            }
        });
    }