AchievementBoard
A class in Root.Township, the global namespace.
Client: a board listing a set of achievements. Hidden until there is a local player, and hidden again once all of them are done.
- Listed in Global namespace: A to B
- Inherits or implements
MonoBehaviour - Attributes
SelectionBase
Constructors
| Member | What it is |
|---|---|
AchievementBoard() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
| Member | What it is |
|---|---|
private GameAchievement[] achievements | Achievements shown on the board. |
private bool isSpreading | Whether spacing is the total length to spread items over instead of the gap between them. |
private AchievementItem itemPrefab | Prefab for one achievement row. |
private LODGroup lodGroup | LOD group the item renderers are added to. |
private Transform parent | Transform the items sit under. |
private float spacing | Gap between items, or the total length when spreading. |
private TextRenderer title | The board title text. |
private TaskCompletedEvent[] toSetup | The task completed events on each row, one per achievement. |
Methods
8 private and internal methods
| Member | What it is |
|---|---|
private void CheckEnabled() | Hides the board if every achievement is locally completed. |
private void InstantiateItems() | Spawns an item per achievement down the board. Not called in this build. |
private void OnDestroy() | Unhooks the player, sync and achievement listeners. |
private void OnDrawGizmos() | Draws preview meshes for the item layout in the editor. |
private void ReceivedSync() | Rechecks the board once after the first task sync. |
private void Start() | Sets up for the current player, or hides the board and waits for the local player. |
private void UpdateAchievement(IPlayer player, GameAchievement achievement) | Rechecks the board when an achievement is completed. |
private void UpdatePlayer(IPlayer player) | Hides the board if all achievements are done; otherwise shows it, sets up the items and listens for completions. |