コード例 #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
ファイル: StartMatchButton.cs プロジェクト: terite/HexChess
    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();
            }
        });
    }