A class in Root.Township, Alta.Character.
A UI text above a player that follows their body and turns to face the local player's head (or the scene camera in the editor).
Constructors
| Member | What it is |
|---|
PlayerText() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
2 private and internal fields
| Member | What it is |
|---|
private PlayerCharacter player | The player this text belongs to. |
private Text text | The UI Text component. |
Properties
| Member | What it is |
|---|
string Text { get; set; } | The shown text. Setting null or empty hides it. |
Methods
5 private and internal methods
| Member | What it is |
|---|
private void DeleteIfLocalPlayer(PlayerController player) | Destroys the text if the given player is the one it belongs to. Nothing in this class subscribes it. |
private void FaceSceneViewCamera() | In the editor, turns to face the current camera. |
private void FaceTransform(Transform transform) | Turns to look at the given transform. |
private void Start() | Finds the PlayerCharacter it belongs to. |
private void Update() | While shown, moves over the player's body and faces the local player's head. |