Attach this script to any obstacle with a collider to enable dynamic updates of the graphs around it.
More...
Attach this script to any obstacle with a collider to enable dynamic updates of the graphs around it.
When the object has moved a certain distance (or actually when it's bounding box has changed by a certain amount) defined by updateError it will call AstarPath.UpdateGraphs and update the graph around it.
- Note
- This script does only work with GridGraph, PointGraph and LayerGridGraph
- See Also
- AstarPath.UpdateGraphs
|
float | checkTime = 0.2F |
| Time in seconds between bounding box checks.
|
|
float | updateError = 1 |
| The minimum change along one of the axis of the bounding box of collider to trigger a graph update.
|
|
|
void | Start () |
| Use this for initialization.
|
|
IEnumerator | UpdateGraphs () |
| Coroutine which checks for changes in the collider's bounding box.
|
|
|
static float | BoundsVolume (Bounds b) |
| Returns the volume of a Bounds object.
|
|
static float BoundsVolume |
( |
Bounds |
b | ) |
|
|
staticprivate |
Returns the volume of a Bounds object.
X*Y*Z
Revert graphs when destroyed.
When the DynamicObstacle is destroyed, a last graph update should be done to revert nodes to their original state
Use this for initialization.
IEnumerator UpdateGraphs |
( |
| ) |
|
|
private |
Coroutine which checks for changes in the collider's bounding box.
Time in seconds between bounding box checks.
bool isWaitingForUpdate = false |
|
private |
The minimum change along one of the axis of the bounding box of collider to trigger a graph update.
The documentation for this class was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/ExampleScenes/ExampleScripts/DynamicGridObstacle.cs