An abstract class in Root.Township, the global namespace.
Asset for a tracked player action (docking an item, destroying something and so on) that feeds tasks and achievements. Server: GameTaskManager collects the ones valid for the current scene and counts them per player.
Constructors
| Member | What it is |
|---|
protected GameAction() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private StatType statType | Backing field for StatType. |
private int targetSceneIndex | Single scene index (-1 for all scenes). Not read anywhere; ValidateScene uses targetSceneIndexes. |
private int[] targetSceneIndexes | Scene indexes the action counts in. Empty means every scene. Read by ValidateScene. |
Properties
| Member | What it is |
|---|
abstract GameActionChannel Channel { get; } | Which kind of action this listens for. Only actions reported on this channel are checked. |
StatType StatType { get; } | The kind of stat this action tracks. |
Events
| Member | What it is |
|---|
event IncrementStat IncrementValue | Raised by IncrementForPlayer. The task manager listens to it. |
event UpdateStat ValueUpdate | Raised by UpdateForPlayer. The task manager listens to it. |
Methods
| Member | What it is |
|---|
void IncrementForPlayer(IPlayer player) | Adds one to this action's count for a player. |
abstract bool IsValid(GameTaskActionArgument argument) | Whether a reported action argument counts for this action. |
virtual int ReceiveNewValue(int currentValue, int newValue) | Combines the current count with a new one. Adds them by default. |
void UpdateForPlayer(IPlayer player, int value) | Sets this action's value for a player. |
void UpdateForPlayer(IPlayer player, float value) | Sets this action's value for a player. |
bool ValidateScene(int sceneIndex) | True if the action applies in the given scene index. An empty scene list means every scene. |
Used in
Members of other types that take, return or hold a GameAction:
DeadStateSettings.diedAction, DeadStateSettings.DiedAction, CustomizationStateSettings.finishCustomizationAction, CustomizationStateSettings.FinishCustomizationAction, GameTaskManager.actionStatMap, GameTaskManager.ClearActionStatForPlayer, GameTaskManager.IncrementForPlayer, GameTaskManager.UpdateForPlayer, IncrementStat.BeginInvoke, IncrementStat.Invoke, PlayerTracker.CurrentActions, PlayerTracker.GetValue, PlayerTracker.statActions, PlayerTracker.UpdateValue, ProgressionSettings.levelUpAction, ProgressionSettings.LevelUpAction, StatReachedAchievement.targetStat, StatReachedAchievement.TargetStat, StatReachedAchievement.UpdateValue, UpdateStat.BeginInvoke, UpdateStat.Invoke.