ManiaMap.Unity
Procedural generation of metroidvania style maps for Unity.
CellArea2D Class Reference

A 2D trigger to detect if an object on a monitored physics layer mask enters or exits a RoomComponent cell. More...

Inheritance diagram for CellArea2D:
CellArea

Static Public Member Functions

static CellArea2D InstantiateCellArea2D (int row, int column, RoomComponent room, int cellLayer, LayerMask triggeringLayers)
 Instantiates a new cell area within the specified room. More...
 
- Static Public Member Functions inherited from CellArea
static CellArea InstantiateCellArea (int row, int column, RoomComponent room, int cellLayer, LayerMask triggeringLayers)
 Instantiates a new cell area within the specified room. More...
 

Properties

BoxCollider2D Collider [getprivate set]
 The attached box collider. More...
 
- Properties inherited from CellArea
int Column [getprotected set]
 
RoomComponent Room [getprotected set]
 The containing room. More...
 
int Row [getprotected set]
 The row index corresponding to the area. More...
 

Private Member Functions

void Awake ()
 
void OnTriggerEnter2D (Collider2D collision)
 Sets the RoomState cell visibility to true and calls the OnCellAreaEntered event on the containing RoomComponent. More...
 
void OnTriggerExit2D (Collider2D collision)
 Calls the OnCellAreaExited event on the containing RoomComponent. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CellArea
void Initialize (int row, int column, RoomComponent room)
 Initializes the base properties for the area. More...
 

Detailed Description

A 2D trigger to detect if an object on a monitored physics layer mask enters or exits a RoomComponent cell.

Definition at line 9 of file CellArea2D.cs.

Member Function Documentation

◆ Awake()

void Awake ( )
private

Definition at line 16 of file CellArea2D.cs.

◆ InstantiateCellArea2D()

static CellArea2D InstantiateCellArea2D ( int  row,
int  column,
RoomComponent  room,
int  cellLayer,
LayerMask  triggeringLayers 
)
static

Instantiates a new cell area within the specified room.

Parameters
rowThe row index of the area.
columnThe column index of the area.
roomThe containing room.
cellLayerThe physics layer assigned to the new cell.
triggeringLayersThe physics layer mask that the cell will detect for trigger events.

Definition at line 29 of file CellArea2D.cs.

◆ OnTriggerEnter2D()

void OnTriggerEnter2D ( Collider2D  collision)
private

Sets the RoomState cell visibility to true and calls the OnCellAreaEntered event on the containing RoomComponent.

Parameters
collisionThe collider triggering the event.

Definition at line 55 of file CellArea2D.cs.

◆ OnTriggerExit2D()

void OnTriggerExit2D ( Collider2D  collision)
private

Calls the OnCellAreaExited event on the containing RoomComponent.

Parameters
collisionThe collider triggering the event.

Definition at line 65 of file CellArea2D.cs.

Property Documentation

◆ Collider

BoxCollider2D Collider
getprivate set

The attached box collider.

Definition at line 14 of file CellArea2D.cs.


The documentation for this class was generated from the following file: