A class in Root.Township, Alta.Character.
Sphere trigger that follows a player's feet to mark their personal space. Pointer checks the personal space layer when aiming, and it is turned off when the player dies.
Constructors
| Member | What it is |
|---|
PersonalSpace() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private Transform cachedTransform | Cached transform of this object. |
private PlayerController character | Backing field for Character. |
private SphereCollider sphereCollider | The personal space sphere. |
Properties
| Member | What it is |
|---|
PlayerController Character { get; } | The player this space belongs to. |
float Radius { get; private set; } | Effective radius, counting the sphere's downward offset. |
Methods
| Member | What it is |
|---|
void DisablePersonalSpace() | Turns off the sphere and this component. Used when the player dies. |
4 private and internal methods
| Member | What it is |
|---|
private void Awake() | Works out Radius from the sphere and how far below the object it sits, and disables itself if there is no player. |
private void LateUpdate() | Moves the sphere to the player's feet. |
private void OnDisable() | Turns off the sphere collider. |
private void OnEnable() | Turns on the sphere collider. |