123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using UnityEngine;
- namespace Pathfinding {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [AddComponentMenu("Pathfinding/Navmesh/RecastTileUpdate")]
- [HelpURL("http://arongranberg.com/astar/documentation/stable/class_pathfinding_1_1_recast_tile_update.php")]
- public class RecastTileUpdate : MonoBehaviour {
- public static event System.Action<Bounds> OnNeedUpdates;
- void Start () {
- ScheduleUpdate();
- }
- void OnDestroy () {
- ScheduleUpdate();
- }
-
- public void ScheduleUpdate () {
- var collider = GetComponent<Collider>();
- if (collider != null) {
- if (OnNeedUpdates != null) {
- OnNeedUpdates(collider.bounds);
- }
- } else {
- if (OnNeedUpdates != null) {
- OnNeedUpdates(new Bounds(transform.position, Vector3.zero));
- }
- }
- }
- }
- }
|