A class in Root.Township, the global namespace.
Component that fires one of two UnityEvents depending on whether the local player has completed an achievement, and shows its description. Client side.
Constructors
| Member | What it is |
|---|
TaskCompletedEvent() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private TextRenderer description | Text renderer that shows the achievement's description. |
private UnityEvent onComplete | Event fired when the achievement is complete. |
private UnityEvent onNonComplete | Event fired when the achievement isn't complete yet. |
private GameAchievement targetAchievement | The achievement to watch. |
Methods
| Member | What it is |
|---|
void SetAchievement(GameAchievement achievement) | Sets the target achievement and sets the component up for it. |
6 private and internal methods
| Member | What it is |
|---|
private void CheckComplete() | Runs after a task sync arrives: fires onComplete if the achievement is now done. |
private void CheckCompleteTask(IPlayer player, GameAchievement achievement) | Fires onComplete when the local player completes the achievement. |
private void GetLocalPlayer(IPlayer player) | Fires onComplete if already done, otherwise onNonComplete, and starts listening for completion. |
private void OnDestroy() | Unhooks from the local player and achievement events. |
private void Setup() | Shows the achievement description and checks the local player, waiting for one if none is set yet. |
private void Start() | Calls Setup if an achievement is assigned. |
Used in
Members of other types that take, return or hold a TaskCompletedEvent: