BomberUnits
...a Unity learning project
Tile Class Reference
+ Inheritance diagram for Tile:
+ Collaboration diagram for Tile:

Public Member Functions

bool IsBlocking ()
 
GameObject SpawnOn (GameObject prefab, bool rand90DegRotation=false, float addElev=0.0f)
 Spawns an instance of the given prefab and returns it.
 
Vector3 GetSpawnPoint ()
 
GameObject SpawnTileObject (bool rand90DegRotation=false, float addElev=0.0f)
 
void SetTileObject (GameObject obj)
 
void DestroyTileObject ()
 
bool HasTileObject ()
 
override string ToString ()
 
Tile GetNeighborInDir (WorldDir dir)
 
GameObject GetTileObject ()
 
Dictionary< WorldDir, TileGetNeighbors ()
 
void FindTileObject ()
 

Static Public Member Functions

static Tile Underneath (Vector3 position)
 

Public Attributes

List< WorldDir > blockedDirections
 
bool isBlocking
 True means AoE cannot add or cross this.
 
GameObject tileObjectPrefab
 A GO to be created during startup.
 

Private Member Functions

void Start ()
 Used to build the Map and create an initial object.
 
void FindNeighbors ()
 Initiates a linecast in each direction to fill the neighbor struct with references.
 
Tile FindTileInDirection (WorldDir dir)
 Execution of a line cast in the given direction to return the next tile. More...
 
void EnsureTileObjParent ()
 
void TryToSpawnTileObjectPrefab ()
 
void DetermineOwnSurface ()
 

Static Private Member Functions

static Tile GetTileInThisOrParent (GameObject obj)
 

Private Attributes

GameObject tileObject
 Reference to present tile object (null if none).
 
Dictionary< WorldDir, Tileneighbors = new Dictionary<WorldDir, Tile>()
 
float deltaYToSurface = 0.0f
 

Static Private Attributes

static GameObject tileObjectHierarchyParent
 

Detailed Description

Definition at line 7 of file Tile.cs.

Member Function Documentation

◆ FindTileInDirection()

Tile FindTileInDirection ( WorldDir  dir)
inlineprivate

Execution of a line cast in the given direction to return the next tile.

The range is limited such that the tile really has to be adjacent. Only colliders of objects with the "Tiles" Layer will be hit.

Definition at line 195 of file Tile.cs.


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