A class in Root.Township, the global namespace.
A skill tree asset for one progression path: its slots, icon and model. Loaded from Resources/ProgressionTrees/; get one with GetProfessionTree.
Constructors
| Member | What it is |
|---|
ProfessionSkillTree() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
7 private and internal fields
| Member | What it is |
|---|
private bool isEnabled | Backing field for IsEnabled. |
private ProgressionPath path | Backing field for Path. |
private GameObject pathModel | Backing field for PathModel. |
private Dictionary<uint, ProgressionSlot> slotMap | Slots by hash, for GetSlot. |
private List<ProgressionSlot> slots | Backing field for Slots. |
private Sprite treeIcon | Backing field for TreeIcon. |
private static Dictionary<ProgressionPath, ProfessionSkillTree> treeMap | All trees by path, loaded once from Resources/ProgressionTrees. |
Properties
| Member | What it is |
|---|
bool IsEnabled { get; } | Whether the tree is turned on. |
ProgressionPath Path { get; } | The progression path this tree belongs to. |
GameObject PathModel { get; } | Model shown for the path. |
List<ProgressionSlot> Slots { get; } | The tree's skill slots. |
Sprite TreeIcon { get; } | Icon sprite for the tree. |
Methods
| Member | What it is |
|---|
static ProfessionSkillTree GetProfessionTree(ProgressionPath path) | Returns the tree for a path, loading all trees on first call. Logs an error if there is none. |
bool GetSlot(uint hash, out ProgressionSlot slot) | Finds a slot in this tree by its hash. |
void OnValidate() | Editor: validates slots and changes any duplicate slot hashes. |
2 private and internal methods
| Member | What it is |
|---|
private void EnsureFullMap() | Fills slotMap from slots on first use and sets each slot's path. |
private void ForwardLoad() | On first load, builds the slot map and lets each slot link to the slots it inherits from. |
Used in
Members of other types that take, return or hold a ProfessionSkillTree: