Skip to main content

ProfessionSkill<T>

An abstract class in Root.Township, the global namespace.

Base for a skill that is a single asset, giving static access to it through Instance and quick checks of whether a player has it.

Constructors​

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

Properties​

MemberWhat it is
static T Instance { get; private set; }The skill asset, set the first time any player unlocks it. Null before then, so the checks return false or 0.

Methods​

MemberWhat it is
static int PlayerLevel(Player targetPlayer)The player's level in this skill, or 0 if Instance isn't set yet.
static int PlayerLevel(PlayerProgressionManager targetPlayer)The player's level in this skill, or 0 if Instance isn't set yet.
static bool PlayerUnlocked(Player targetPlayer)Whether the player has this skill unlocked. False if Instance isn't set yet.
static bool PlayerUnlocked(PlayerProgressionManager targetPlayer)Whether the player has this skill unlocked. False if Instance isn't set yet.
override void Unlock(PlayerProgressionManager player)Stores this asset as Instance and runs the base unlock.