Class BuildingTool
This is the terraforming tool. This class is responsible for scheduling terrain modifications based on selection changes and user input.
Inheritance
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
BuildingTool
Inherited Members
Namespace: TycoonTerrain.Tools
Assembly: TycoonTerrainAssembly.dll
Syntax
[DisallowMultipleComponent]
[AddComponentMenu("Tycoon Tile/Tools/Building Tool")]
public class BuildingTool : SelectionToolBase
Fields
OnBuildDeniedEvent
Declaration
[Header("Events")]
public UnityEvent OnBuildDeniedEvent
Field Value
| Type | Description |
|---|---|
| Unity |
OnBuildEvent
Declaration
public UnityEvent OnBuildEvent
Field Value
| Type | Description |
|---|---|
| Unity |
Prefab
The construction prefab.
Declaration
public ConstructableDefinition Prefab
Field Value
| Type | Description |
|---|---|
| Constructable |
Properties
IsPlacementValid
Indicates whether the current terrain selection is valid for building placement.
Declaration
public bool IsPlacementValid { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Rotation
Gets or sets the selected building rotation.
Declaration
public CardinalDirection Rotation { get; set; }
Property Value
| Type | Description |
|---|---|
| Cardinal |
SelectionCenterHeightScaled
Declaration
public Vector3 SelectionCenterHeightScaled { get; }
Property Value
| Type | Description |
|---|---|
| Unity |
SelectionCenterWorldPosition
Declaration
public Vector3 SelectionCenterWorldPosition { get; }
Property Value
| Type | Description |
|---|---|
| Unity |
Methods
Awake()
Declaration
protected override void Awake()
Overrides
CheckPlacement()
Checks the placement validity.
Declaration
public PlacementValidResult CheckPlacement()
Returns
| Type | Description |
|---|---|
| Placement |
A valid placement result if placement is valid. Otherwise, an invalid placement result with a reason. |
OnDisable()
Declaration
protected override void OnDisable()
Overrides
OnEnable()
Declaration
protected override void OnEnable()