Ejemplo n.º 1
0
    void FixedUpdate()
    {
        if (!_view.IsMine)
        {
            return;
        }

        var axisAmountToRotate = Input.GetAxisRaw("Horizontal");

        if (axisAmountToRotate != 0)
        {
            _server.PlayeRequestRotate(PhotonNetwork.LocalPlayer, axisAmountToRotate);
        }

        if (Input.GetKey(KeyCode.UpArrow) || Input.GetKey(KeyCode.W))
        {
            _server.PlayerRequestAccelerate(PhotonNetwork.LocalPlayer);
        }
    }