A class in Root.Township, the global namespace.
Fails a growth stage when its tree is chopped down to a small size, so young trees that are cut stop growing.
Constructors
| Member | What it is |
|---|
TreeChopDetector() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private GrowthStageComponent growthStage | The growth stage that is failed. |
private int minSizeToStunt | Tree size at or below which a chop stunts it. |
private WoodcutTree tree2 | The woodcut tree whose chops are watched. |
Methods
4 private and internal methods
| Member | What it is |
|---|
private void Awake() | Subscribes to chops if the growth stage is set up, and listens for setup changes. |
private void HandleSetupChanged(GrowthStageComponent obj) | Re-subscribes or unsubscribes from chops when the growth stage's setup changes. |
private void StartHandlingChopped(bool isSubscribing) | Unhooks the tree's chop event and hooks it again if isSubscribing is true. |
private void TreeChopped() | Fails the growth stage (without destroying) if the tree's total size is at or below minSizeToStunt. |