示例#1
0
        void DoFindClosestEdge()
        {
            if (_agent == null)
            {
                return;
            }

            UnityEngine.AI.NavMeshHit _NavMeshHit;

            bool _nearestEdgeFound = _agent.FindClosestEdge(out _NavMeshHit);

            nearestEdgeFound.Value = _nearestEdgeFound;

            position.Value = _NavMeshHit.position;
            normal.Value   = _NavMeshHit.normal;
            distance.Value = _NavMeshHit.distance;
            mask.Value     = _NavMeshHit.mask;
            hit.Value      = _NavMeshHit.hit;

            if (_nearestEdgeFound)
            {
                if (!FsmEvent.IsNullOrEmpty(nearestEdgeFoundEvent))
                {
                    Fsm.Event(nearestEdgeFoundEvent);
                }
            }
            else
            {
                if (!FsmEvent.IsNullOrEmpty(nearestEdgeNotFoundEvent))
                {
                    Fsm.Event(nearestEdgeNotFoundEvent);
                }
            }
        }