Struct Int2GridCell
Namespace: AnyPath.Graphs.Int2Grid
Assembly: Assembly-CSharp.dll
Syntax
public struct Int2GridCell : IEquatable<Int2GridCell>, INodeFlags
Constructors
| Improve this Doc View SourceInt2GridCell(int2, Single, Int32)
Creates a hexgrid cell
Declaration
public Int2GridCell(int2 position, float enterCost = 0F, int flags = 0)
Parameters
Type | Name | Description |
---|---|---|
Unity.Mathematics.int2 | position | Position of this cell |
System.Single | enterCost | Optional extra cost for entering this cell |
System.Int32 | flags | Optional flags for this cell |
Int2GridCell(Vector3Int, Single, Int32)
Creates a hexgrid cell
Declaration
public Int2GridCell(Vector3Int position, float enterCost = 0F, int flags = 0)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3Int | position | Position of this cell, note that the Z value is not used |
System.Single | enterCost | Optional extra cost for entering this cell |
System.Int32 | flags | Optional flags for this cell |
Properties
| Improve this Doc View SourceEnterCost
The cost associated with entering this cell. Note that this is additional to the distance and should not be a negative value.
Declaration
public readonly float EnterCost { get; }
Property Value
Type | Description |
---|---|
System.Single |
Flags
Flags for this location. Can be used in conjunction with FlagBitmask<TNode>.
Declaration
public readonly int Flags { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsOpen
Returns wether this cell is "walkable", that is, the EnterCost is not infinity.
Declaration
public readonly bool IsOpen { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Position
Coordinate of this cell
Declaration
public readonly int2 Position { get; }
Property Value
Type | Description |
---|---|
Unity.Mathematics.int2 |
Methods
| Improve this Doc View SourceToVector3Int(Int32)
Utility to convert this cell into a Vector3Int for usage with a Unity Tilemap
Declaration
public Vector3Int ToVector3Int(int z = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | z | Optional Z value for the Vector3Int |
Returns
Type | Description |
---|---|
UnityEngine.Vector3Int | The position of this cell as a Vector3Int |
Operators
| Improve this Doc View SourceImplicit(Int2GridCell to int2)
Implicitly convert this location to an int2 value.
Declaration
public static implicit operator int2(Int2GridCell cell)
Parameters
Type | Name | Description |
---|---|---|
Int2GridCell | cell |
Returns
Type | Description |
---|---|
Unity.Mathematics.int2 |
Implicit(Int2GridCell to Vector2Int)
Implicitly convert this location to an Vector2Int value.
Declaration
public static implicit operator Vector2Int(Int2GridCell cell)
Parameters
Type | Name | Description |
---|---|---|
Int2GridCell | cell |
Returns
Type | Description |
---|---|
UnityEngine.Vector2Int |