Skip to main content

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​

MemberWhat it is
OneTimeUpgradeInteraction()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

1 private and internal field
MemberWhat it is
private HashSet<int> upgradedPlayerIDsUser IDs of players who already got the upgrade. Saved through OneTimeUpgradeSaveData.

Methods​

MemberWhat 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.