Skip to main content

StatReachedAchievement

A class in Root.Township, the global namespace.

Game achievement asset that completes for a player once a game action's tracked value reaches a set amount.

Constructors​

MemberWhat it is
StatReachedAchievement()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

2 private and internal fields
MemberWhat it is
private int requiredValue needed to complete.
private GameAction targetStatBacking field for TargetStat.

Properties​

MemberWhat it is
GameAction TargetStat { get; }The game action whose value is watched.

Methods​

MemberWhat it is
override void Initialize()Subscribes to the target action's value updates, once.
1 private and internal method
MemberWhat it is
private void UpdateValue(GameAction stat, IPlayer player, float value)Completes the achievement for the player when the value is at least required.