OneTimeUpgradeInteraction
A class in Root.Township, the global namespace.
A StatUpgradeTarget that gives each player its stat upgrade only once, remembering who has had it in the save. Server-side; the upgrade only applies on the server.
Constructors
| Member | What it is |
|---|
OneTimeUpgradeInteraction() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
1 private and internal field
| Member | What it is |
|---|
private HashSet<int> upgradedPlayerIDs | User IDs of players who already got the upgrade. Saved through OneTimeUpgradeSaveData. |
Methods
| Member | What it is |
|---|
void OneTimeUpgrade(IPlayer player) | Upgrades the player if their user ID isn't in upgradedPlayerIDs yet, then records them. |
void UpgradePlayerNoValidCheck(IPlayer player) | Server: applies the upgrade to the player's controller without checking whether they already had it. |