示例#1
0
 public static void SetGravityStrength(VRCPlayerApi player, float gravity)
 {
     if (!player.isLocal)
     {
         return;
     }
     player.GetPlayerController().SetGravityStrength(gravity);
 }
示例#2
0
 public static void SetJumpImpulse(VRCPlayerApi player, float jump)
 {
     if (!player.isLocal)
     {
         return;
     }
     player.GetPlayerController().SetJump(jump);
 }
示例#3
0
 public static float GetGravityStrength(VRCPlayerApi player)
 {
     if (!player.isLocal)
     {
         return(0);
     }
     return(player.GetPlayerController().GetGravityStrength());
 }
示例#4
0
 public static float GetJumpImpulse(VRCPlayerApi player)
 {
     if (!player.isLocal)
     {
         return(0);
     }
     return(player.GetPlayerController().GetJump());
 }
示例#5
0
 public static void SetWalkSpeed(VRCPlayerApi player, float speed)
 {
     if (!player.isLocal)
     {
         return;
     }
     player.GetPlayerController().SetWalkSpeed(speed);
 }
示例#6
0
 public static float GetWalkSpeed(VRCPlayerApi player)
 {
     if (!player.isLocal)
     {
         return(0);
     }
     return(player.GetPlayerController().GetWalkSpeed());
 }
示例#7
0
 public static bool IsGrounded(VRCPlayerApi player)
 {
     if (!player.isLocal)
     {
         return(false);
     }
     return(player.GetPlayerController().IsGrounded());
 }
示例#8
0
 public static void UseLegacyLocomotion(VRCPlayerApi player)
 {
     if (!player.isLocal)
     {
         return;
     }
     player.GetPlayerController().UseLegacyLocomotion();
 }
示例#9
0
 public static void TeleportToOrientation(VRCPlayerApi player, Vector3 position, Quaternion rotation, VRC_SceneDescriptor.SpawnOrientation orientation)
 {
     if (!player.isLocal)
     {
         return;
     }
     player.GetPlayerController().Teleport(position, rotation, orientation == VRC_SceneDescriptor.SpawnOrientation.AlignRoomWithSpawnPoint);
 }
示例#10
0
 public static void SetVelocity(VRCPlayerApi player, Vector3 velocity)
 {
     if (!player.isLocal)
     {
         return;
     }
     player.GetPlayerController().SetVelocity(velocity);
 }
示例#11
0
 public static void SetGravityStrength(VRCPlayerApi player, float gravity)
 {
     if (!player.isLocal)
     {
         throw new Exception("[VRCPlayerAPI.SetGravityStrength] You cannot set gravity strength for remote clients!");
     }
     player.GetPlayerController().SetGravityStrength(gravity);
 }
示例#12
0
 public static Vector3 GetVelocity(VRCPlayerApi player)
 {
     if (!player.isLocal)
     {
         return(Vector3.zero);
     }
     return(player.GetPlayerController().GetVelocity());
 }
示例#13
0
 public static void SetJumpImpulse(VRCPlayerApi player, float jump)
 {
     if (!player.isLocal)
     {
         throw new Exception("[VRCPlayerAPI.SetJumpImpulse] You cannot set jump impulse for remote clients!");
     }
     player.GetPlayerController().SetJump(jump);
 }
示例#14
0
 public static float GetGravityStrength(VRCPlayerApi player)
 {
     if (!player.isLocal)
     {
         throw new Exception("[VRCPlayerAPI.GetGravityStrength] You cannot get gravity strength for remote clients!");
     }
     return(player.GetPlayerController().GetGravityStrength());
 }
示例#15
0
 public static void SetWalkSpeed(VRCPlayerApi player, float speed)
 {
     if (!player.isLocal)
     {
         throw new Exception("[VRCPlayerAPI.SetWalkSpeed] You cannot set walk speed for remote clients!");
     }
     player.GetPlayerController().SetWalkSpeed(speed);
 }
示例#16
0
 public static float GetJumpImpulse(VRCPlayerApi player)
 {
     if (!player.isLocal)
     {
         throw new Exception("[VRCPlayerAPI.GetJumpImpulse] You cannot get jump impulse for remote clients!");
     }
     return(player.GetPlayerController().GetJump());
 }
示例#17
0
 public static float GetWalkSpeed(VRCPlayerApi player)
 {
     if (!player.isLocal)
     {
         throw new Exception("[VRCPlayerAPI.GetWalkSpeed] You cannot get walk speed for remote clients!");
     }
     return(player.GetPlayerController().GetWalkSpeed());
 }
示例#18
0
 public static void TeleportTo(VRCPlayerApi player, Vector3 position, Quaternion rotation)
 {
     if (!player.isLocal)
     {
         return;
     }
     player.GetPlayerController().Teleport(position, rotation, false);
 }
示例#19
0
 public static bool IsGrounded(VRCPlayerApi player)
 {
     if (!player.isLocal)
     {
         // TODO verify remote player values when not grounded.
         return(true);
     }
     return(player.GetPlayerController().IsGrounded());
 }
示例#20
0
        public static void Immobilize(VRCPlayerApi player, bool immobilized)
        {
            if (!player.isLocal)
            {
                throw new Exception("[VRCPlayerAPI.Immobilize] You cannot set remote players Immobilized");
            }

            player.GetPlayerController().Immobilize(immobilized);
        }
示例#21
0
        public static void TeleportToOrientationLerp(VRCPlayerApi player, Vector3 position, Quaternion rotation, VRC_SceneDescriptor.SpawnOrientation orientation, bool lerp)
        {
            if (!player.isLocal)
            {
                player.LogWarning("[VRCPlayerAPI.TeleportTo] Teleporting remote players will do nothing.");
                return;
            }

            // Ignore lerp since there is no networking here
            player.GetPlayerController().Teleport(position, rotation, orientation == VRC_SceneDescriptor.SpawnOrientation.AlignRoomWithSpawnPoint);
        }
示例#22
0
 public static VRC_Pickup GetPickupInHand(VRCPlayerApi player, VRC_Pickup.PickupHand hand)
 {
     return(player.GetPlayerController().GetHeldPickup(hand));
 }
示例#23
0
 public static VRCPlayerApi.TrackingData GetTrackingData(VRCPlayerApi player, VRCPlayerApi.TrackingDataType trackingDataType)
 {
     return(player.GetPlayerController().GetTrackingData(trackingDataType));
 }