コード例 #1
0
ファイル: NetworkManager.cs プロジェクト: dlannan/quikpong
    // client function
    public void OnConnected(NetworkMessage netMsg)
    {
        Debug.Log("Connected to server");
        nwState = "Client Connected.";
        statusImg.GetComponentsInChildren <Text>()[1].text = nwState;

        // Client disables player input for Server Side (Left Hand Side)
        playerOne.CommInput();
        // Player Two(client) must sync its key presses to move the bat with the server.
        playerTwo.CommOutput();
        // Client runs ball as per normal - with regular sync.
        pongBall.CommSyncStart(this);

        // All ready, jump into the game!!
    }