コード例 #1
0
ファイル: PlayerSyncManager.cs プロジェクト: Spangls/CubeWars
    private void FixedUpdate()
    {
        if (NetworkProfile.BeginMatch && PlayerHaveNewPosition() && i == 5)
        {
            PositionPacket PositionPacket = new PositionPacket(transform.position.x, transform.position.y, transform.position.z, PlayerCharacterController.GetPitch(), PlayerCharacterController.GetYaw());
            NetworkManager.SendPacket(PositionPacket);
            i = 0;
        }

        if (i == 10)
        {
            i = 0;
        }

        WriteCurrentPosition();
        i++;
    }
コード例 #2
0
 /// <summary>
 /// Перемещение камеры
 /// </summary>
 private void LateUpdate()
 {
     //Поворот камеры
     SetRotateAngle(m_PlayerCharacterController.GetYaw(), m_PlayerCharacterController.GetPitch(), m_PlayerCharacterController.rotationSensivity);
 }