Class ConstructableDefinition
Defines a constructable object for Tycoon Tile terrain.
Namespace: TycoonTerrain.Core
Assembly: TycoonTerrainAssembly.dll
Syntax
[CreateAssetMenu(menuName = "Tycoon Tile/Constructable Definition")]
public class ConstructableDefinition : ScriptableObject
Fields
Length
The length of the constructable.
Declaration
public int Length
Field Value
Type | Description |
---|---|
Int32 |
Prefab
The UnityEngine.GameObject to instantiate when a build is initiated.
Declaration
public GameObject Prefab
Field Value
Type | Description |
---|---|
UnityEngine.GameObject |
Width
The width of the constructable.
Declaration
public int Width
Field Value
Type | Description |
---|---|
Int32 |
Properties
Size
The size of the constructable in both directions.
Declaration
public int2 Size { get; }
Property Value
Type | Description |
---|---|
Unity.Mathematics.int2 |
Methods
CheckPlacement(TerrainSelection)
Determines whether the [the specified terrain selection] [is a valid placement] for this building. Override this function to provide custom placement rules.
Declaration
public virtual PlacementValidResult CheckPlacement(TerrainSelection selection)
Parameters
Type | Name | Description |
---|---|---|
TerrainSelection | selection | The terrain selection. |
Returns
Type | Description |
---|---|
PlacementValidResult |
|
GetFootPrint(CardinalDirection)
Gets the footprint size for a given rotation.
Declaration
public int2 GetFootPrint(CardinalDirection rotation)
Parameters
Type | Name | Description |
---|---|---|
CardinalDirection | rotation | The rotation. |
Returns
Type | Description |
---|---|
Unity.Mathematics.int2 | The size of the construble in a given rotation. |
GetRotation(CardinalDirection)
Gets the rotation quaternion for a given rotation direction.
Declaration
public Quaternion GetRotation(CardinalDirection rotation)
Parameters
Type | Name | Description |
---|---|---|
CardinalDirection | rotation | The rotation direction |
Returns
Type | Description |
---|---|
UnityEngine.Quaternion | The rotation quaternion for a given rotation direction. |
See Also
UnityEngine.ScriptableObject