changes GetPlayerPosition to GetPlayerBody and GetPlayerCamera

This commit is contained in:
_nebula 2023-11-13 12:58:24 +00:00
parent 3d682063e7
commit 1aafd306bc
2 changed files with 11 additions and 5 deletions

View File

@ -38,11 +38,16 @@ public interface IQSBAPI
string GetPlayerName(uint playerID);
/// <summary>
/// Returns the position of a given player.
/// This position is in world space, where (0, 0, 0) is roughly where the local player is located.
/// Returns the body object of a given player. The pivot of this object is at the player's feet.
/// </summary>
/// <param name="playerID">The ID of the player you want the position of.</param>
Vector3 GetPlayerPosition(uint playerID);
/// <param name="playerID">The ID of the player you want the body of.</param>
GameObject GetPlayerBody(uint playerID);
/// <summary>
/// Returns the camera object of a given player. The pivot of this object is at the player's point of view.
/// </summary>
/// <param name="playerID">The ID of the player you want the camera of.</param>
GameObject GetPlayerCamera(uint playerID);
/// <summary>
/// Returns true if a given player has fully loaded into the game. If the local player is still loading into the game, this will return false.

View File

@ -25,7 +25,8 @@ public class QSBAPI : IQSBAPI
public uint GetLocalPlayerID() => QSBPlayerManager.LocalPlayerId;
public string GetPlayerName(uint playerId) => QSBPlayerManager.GetPlayer(playerId).Name;
public Vector3 GetPlayerPosition(uint playerId) => QSBPlayerManager.GetPlayer(playerId).Body.transform.position;
public GameObject GetPlayerBody(uint playerId) => QSBPlayerManager.GetPlayer(playerId).Body;
public GameObject GetPlayerCamera(uint playerId) => QSBPlayerManager.GetPlayer(playerId).CameraBody;
public bool GetPlayerReady(uint playerId)
{