A* Pathfinding Project
4.1.19
The A* Pathfinding Project for Unity 3D
|
Helper for drawing Gizmos in a performant way. More...
Helper for drawing Gizmos in a performant way.
This is a replacement for the Unity Gizmos class as that is not very performant when drawing very large amounts of geometry (for example a large grid graph). These gizmos can be persistent, so if the data does not change, the gizmos do not need to be updated.
How to use
Classes | |
class | Builder |
Helper for drawing gizmos. More... | |
struct | Hasher |
Combines hashes into a single hash value. More... | |
struct | MeshWithHash |
Public Member Functions | |
void | ClearCache () |
Destroys all cached meshes. More... | |
bool | Draw (Hasher hasher) |
Schedules the meshes for the specified hash to be drawn. More... | |
void | DrawExisting () |
Schedules all meshes that were drawn the last frame (last time FinalizeDraw was called) to be drawn again. More... | |
void | FinalizeDraw () |
Call after all Draw commands for the frame have been done to draw everything. More... | |
GraphGizmoHelper | GetGizmoHelper (AstarPath active, Hasher hasher) |
GraphGizmoHelper | GetSingleFrameGizmoHelper (AstarPath active) |
bool | HasCachedMesh (Hasher hasher) |
True if there already is a mesh with the specified hash. More... | |
Public Attributes | |
Material | lineMaterial |
Material to use for the navmesh outline in the editor. More... | |
Material | surfaceMaterial |
Material to use for the navmesh in the editor. More... | |
Private Member Functions | |
Mesh | GetMesh () |
void | PoolMesh (Mesh mesh) |
void | RemoveUnusedMeshes (List< MeshWithHash > meshList) |
Private Attributes | |
Stack< Mesh > | cachedMeshes = new Stack<Mesh>() |
HashSet< ulong > | existingHashes = new HashSet<ulong>() |
List< MeshWithHash > | meshes = new List<MeshWithHash>() |
HashSet< ulong > | usedHashes = new HashSet<ulong>() |
void ClearCache | ( | ) |
Destroys all cached meshes.
Used to make sure that no memory leaks happen in the Unity Editor.
Schedules the meshes for the specified hash to be drawn.
void DrawExisting | ( | ) |
Schedules all meshes that were drawn the last frame (last time FinalizeDraw was called) to be drawn again.
Also draws any new meshes that have been added since FinalizeDraw was last called.
void FinalizeDraw | ( | ) |
Call after all Draw commands for the frame have been done to draw everything.
GraphGizmoHelper GetGizmoHelper | ( | AstarPath | active, |
Hasher | hasher | ||
) |
|
private |
GraphGizmoHelper GetSingleFrameGizmoHelper | ( | AstarPath | active | ) |
bool HasCachedMesh | ( | Hasher | hasher | ) |
True if there already is a mesh with the specified hash.
|
private |
|
private |
|
private |
|
private |
Material lineMaterial |
Material to use for the navmesh outline in the editor.
|
private |
Material surfaceMaterial |
Material to use for the navmesh in the editor.
|
private |