Class DoorLineGrid3D
A simple data class that holds information about a single door line.
Inheritance
Implements
Namespace: Edgar.Unity
Assembly: cs.temp.dll.dll
Syntax
public class DoorLineGrid3D : IDoorLine
Remarks
The door line is represented as tiles rather than points.
Why not use DoorHandlerGrid3D directly? DoorHandlerGrid3D is a MonoBehaviour which means that it is not easy to store it and create new instance.
Constructors
DoorLineGrid3D(Vector3Int, Vector3Int, Int32, Int32, DoorHandlerGrid3D, Vector3Int, DoorSocketBase, DoorDirection)
Declaration
public DoorLineGrid3D(Vector3Int from, Vector3Int to, int width, int height, DoorHandlerGrid3D doorHandler, Vector3Int directionVector, DoorSocketBase socket, DoorDirection direction)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | from | |
Vector3Int | to | |
System.Int32 | width | |
System.Int32 | height | |
DoorHandlerGrid3D | doorHandler | |
Vector3Int | directionVector | |
DoorSocketBase | socket | |
DoorDirection | direction |
Properties
Direction
Direction of the door when it comes to entrances/exits. Each door is undirected by default, meaning it can serve both as an entrance and an exit.
Declaration
public DoorDirection Direction { get; }
Property Value
Type | Description |
---|---|
DoorDirection |
DirectionVector
Direction vector of the door. If you go clockwise on the outline of the room template and assign a direction to each side of polygon, the direction of the door is equal to the direction of the polygon side to which it belongs.
Declaration
public Vector3Int DirectionVector { get; }
Property Value
Type | Description |
---|---|
Vector3Int |
Remarks
It holds that From + Direction * (Width - 1) == To. The Up direction is the same as Vector3Int.Up.
DoorHandler
Declaration
public DoorHandlerGrid3D DoorHandler { get; }
Property Value
Type | Description |
---|---|
DoorHandlerGrid3D |
From
The first tile of the door.
Declaration
public Vector3Int From { get; }
Property Value
Type | Description |
---|---|
Vector3Int |
Height
Width of the door (number of tiles).
Declaration
public int Height { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Socket
Socket of the door, can be null.
Declaration
public DoorSocketBase Socket { get; }
Property Value
Type | Description |
---|---|
DoorSocketBase |
To
The last tile of the door.
Declaration
public Vector3Int To { get; }
Property Value
Type | Description |
---|---|
Vector3Int |
Remarks
It can be equal to the From field if the width is equal to 1.
Width
Width of the door (number of tiles).
Declaration
public int Width { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Get3DBounds(Boolean)
Computes the bounds of the door in the 3D space. Mostly used for gizmo purposes.
Declaration
public BoundsInt Get3DBounds(bool includeRepeat = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | includeRepeat |
Returns
Type | Description |
---|---|
BoundsInt |
Remarks
The bounds are represented as points bounding the door (which is described in tiles).
GetFacingDirection()
Gets the facing direction of the door. "Facing" means the direction that points outside the current room.
Declaration
public Vector3Int GetFacingDirection()
Returns
Type | Description |
---|---|
Vector3Int |
Explicit Interface Implementations
IDoorLine.Length
Declaration
int IDoorLine.Length { get; }
Returns
Type | Description |
---|---|
System.Int32 |