![]() |
FCV Engine 0.1
A tool and framework for tutorials in game development
|
Provides functionality to identify and manage walkable platform tiles in a tilemap. Implements a singleton pattern to ensure only one instance exists and offers methods for detecting platforms below a specific position, identifying the closest connected platform, and visualizing walkable areas. More...
Public Member Functions | |
Vector3Int | GetPlatformBelow (Vector3 position) |
Finds the tile directly below a specified position within the tilemap. Returns a maximum vector value if no tile is found within a certain threshold. | |
List< Vector3Int > | GetClosestPlatform (Vector3 position) |
Retrieves all tiles forming the closest connected platform beneath a given position. Includes tiles to the left and right, as long as they are walkable and uninterrupted. | |
Private Member Functions | |
void | Awake () |
Does a singleton check and if one already exists deletes itself. | |
List< Vector3Int > | CheckPlatformInDirection (Vector3Int start, Vector2Int direction) |
Checks for all valid platform tiles in a specified direction, ensuring there are no overlapping obstacles above them. Continues searching until an invalid tile or obstacle is encountered. | |
void | OnDrawGizmos () |
Will display gizmos for all walkable positions if list is valid and has elements. | |
Provides functionality to identify and manage walkable platform tiles in a tilemap. Implements a singleton pattern to ensure only one instance exists and offers methods for detecting platforms below a specific position, identifying the closest connected platform, and visualizing walkable areas.
Definition at line 14 of file PlatformFinder.cs.
|
private |
Checks for all valid platform tiles in a specified direction, ensuring there are no overlapping obstacles above them. Continues searching until an invalid tile or obstacle is encountered.
start | The starting tile position. |
direction | The direction to search in (e.g., left or right). |
Definition at line 88 of file PlatformFinder.cs.
List< Vector3Int > GetClosestPlatform | ( | Vector3 | position | ) |
Retrieves all tiles forming the closest connected platform beneath a given position. Includes tiles to the left and right, as long as they are walkable and uninterrupted.
position | The position to search from. |
Definition at line 66 of file PlatformFinder.cs.
Vector3Int GetPlatformBelow | ( | Vector3 | position | ) |
Finds the tile directly below a specified position within the tilemap. Returns a maximum vector value if no tile is found within a certain threshold.
position | The position to search from. |
Definition at line 41 of file PlatformFinder.cs.