viewers access
public static class Player.PlayerManager
CyberPsychosis > Player > PlayerManager
Game a static class that keeps track of basic game related mechanics
| Type | Name | Description |
|---|---|---|
static void |
SetSingleton | Sets the player singleton, basically controlls all player logic the game works on |
static void |
SetPosition | Sets the position of the player |
static void |
SetEulerAngles | Sets the euler angles of the player, using PlayerController.SetCameraRotation() is prefered. |
static void |
SetVelocity | Sets the player velocity, |
static Vector3 |
GetPosition | Returns the player position |
static Vector3 |
GetEulerAngles | Returns the player euler angles |
static Vector3 |
GetVelocity | Returns the player velocity |
static float |
GetDashCooldown | Returns the dash cooldown as a range between 0 and 1 where 1 means its ready |
static PlayerController |
GetPlayer | Returns the PlayerController |
static void |
Damage | Deal damage, reduces the Health, clamped between 0 and maxHealth |
static void |
Heal | Heal the player, increases the Health, clamped between 0 and maxHealth |
static void |
AddScore | Increases the score of the player |
static void |
AddCurrency | Increases the players currency by the input amount |
static void |
SpendCurrency | Spends the currency, reduces its by the input amount |
static void |
Reset | Resets the player, sets the health back to the full amount, empties its velocity and moves it back to the starting point |
| Type | Name | Description |
|---|---|---|
static UnityEvent<int> |
OnDamaged | Called when the player gets dealed damage |
static UnityEvent<int> |
OnHeal | Called when the player is healed |
static UnityEvent<int> |
OnCurrencyChanged | Called when the players currency increases or decreases |
static UnityEvent<int> |
OnScoreChanged | Called when the score is changed |
static UnityEvent<PlayerController, JumpBehaviour> |
OnJump | Called when the player jumps, wall jumps or double jumps |
static UnityEvent<PlayerController, DashMovementBehaviour> |
OnDash | Called when the player dashes |
static UnityEvent<PlayerController, GroundPoundMovementBehaviour> |
OnGroundPoundStart | Called when the player starts ground pounding |
static UnityEvent<PlayerController, GroundPoundMovementBehaviour> |
OnGroundPoundStop | Called when the player hits the ground while ground pounding |
static UnityEvent<PlayerController, SlideMovementBehaviour> |
OnSlideStart | Called when the player starts sliding |
static UnityEvent<PlayerController, SlideMovementBehaviour> |
OnSlideStop | Called when the player stops sliding |