コード例 #1
0
        public override void OnInit()
        {
            //recalculateTimer = 4f;
            pathNode = 0;
            if (path == null)
            {
                path = new UnityEngine.AI.NavMeshPath();
            }
            Vector3    desiredPos;
            GameObject targetGameObject = (graph as AIGraph).GetVariable <GameObject>("targetObject");

            if (targetGameObject == null)
            {
                Vector3 targetPosition = (graph as AIGraph).GetVariable <Vector3>("targetObject");
                if (targetPosition == null)
                {
                    foundPath = false;
                    return;
                }
                desiredPos = targetPosition;
            }
            else
            {
                desiredPos = targetGameObject.transform.position;
            }
            UnityEngine.AI.NavMesh.CalculatePath((graph as AIGraph).GetVariable <Transform>("transform").position, desiredPos, UnityEngine.AI.NavMesh.AllAreas, path);
            foundPath = true;
            (graph as AIGraph).SetVariable("UpdateDelay", 0.1f);
            giveUpTimer = Time.timeSinceLevelLoad + giveUpTime;
            //recalculateTimer = Time.timeSinceLevelLoad + recalculateTime;
        }
コード例 #2
0
        float CalculatePathLength(Vector3 targetPosition)
        {
            // Create a path and set it based on a target position.
            UnityEngine.AI.NavMeshPath path = new UnityEngine.AI.NavMeshPath();
            if (nav.enabled)
            {
                nav.CalculatePath(targetPosition, path);
            }

            // Create an array of points which is the length of the number of corners in the path + 2.
            Vector3[] allWayPoints = new Vector3[path.corners.Length + 2];

            // The first point is the enemy's position.
            allWayPoints[0] = transform.position;

            // The last point is the target position.
            allWayPoints[allWayPoints.Length - 1] = targetPosition;

            // The points inbetween are the corners of the path.
            for (int i = 0; i < path.corners.Length; i++)
            {
                allWayPoints[i + 1] = path.corners[i];
            }

            // Create a float to store the path length that is by default 0.
            float pathLength = 0;

            // Increment the path length by an amount equal to the distance between each waypoint and the next.
            for (int i = 0; i < allWayPoints.Length - 1; i++)
            {
                pathLength += Vector3.Distance(allWayPoints[i], allWayPoints[i + 1]);
            }

            return(pathLength);
        }
コード例 #3
0
        private IEnumerator UpdatePath()
        {
            // Wait for the path to be ready.
            yield return(new WaitForSeconds(k_PathDelay));

            while (m_Agent.pathPending)
            {
                yield return(null);
            }

            // Turn the line renderer on.
            m_Line.enabled = true;

            // Get the path from the NavMeshAgent.
            UnityEngine.AI.NavMeshPath path = m_Agent.path;

            // Set the LineRenderer to have as many points as the path has corners.
            m_Line.SetVertexCount(path.corners.Length);

            // Go through all the corners and set the line's points to the corners' positions.
            for (int i = 0; i < path.corners.Length; i++)
            {
                m_Line.SetPosition(i, path.corners[i]);
            }
        }
コード例 #4
0
        void DoCalculatePath()
        {
            _getNavMeshPathProxy();
            if (_NavMeshPathProxy == null)
            {
                return;
            }


            UnityEngine.AI.NavMeshPath _path = new UnityEngine.AI.NavMeshPath();

            bool _found = UnityEngine.AI.NavMesh.CalculatePath(sourcePosition.Value, targetPosition.Value, passableMask.Value, _path);

            _NavMeshPathProxy.path = _path;

            resultingPathFound.Value = _found;

            if (_found)
            {
                if (!FsmEvent.IsNullOrEmpty(resultingPathFoundEvent))
                {
                    Fsm.Event(resultingPathFoundEvent);
                }
            }
            else
            {
                if (!FsmEvent.IsNullOrEmpty(resultingPathNotFoundEvent))
                {
                    Fsm.Event(resultingPathNotFoundEvent);
                }
            }
        }
コード例 #5
0
        public Vector3 GetMapRandomPosition(Vector2 size)
        {
            var randomCircle   = UnityEngine.Random.insideUnitCircle;
            var x              = randomCircle.x * size.x;
            var y              = this.transform.position.y;
            var z              = randomCircle.y * size.y;
            var targetPosition = new Vector3(x, y, z);
            var path           = new UnityEngine.AI.NavMeshPath();

            if (UnityEngine.AI.NavMesh.CalculatePath(transform.position, targetPosition, UnityEngine.AI.NavMesh.AllAreas, path))
            {
                if (path.status == UnityEngine.AI.NavMeshPathStatus.PathComplete)
                {
                    return(targetPosition);
                }
                else
                {
                    return(GetMapRandomPosition(size));
                }
            }
            else
            {
                return(GetMapRandomPosition(size));
            }
            return(Vector3.zero);
        }
コード例 #6
0
 private void Awake()
 {
     path            = new UnityEngine.AI.NavMeshPath();
     m_character     = GetComponent <PersonCharacter>();
     m_agent         = GetComponentInChildren <UnityEngine.AI.NavMeshAgent>();
     m_agent.enabled = false;
 }
コード例 #7
0
        static StackObject *CalculatePath_21(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.AI.NavMeshPath path = (UnityEngine.AI.NavMeshPath) typeof(UnityEngine.AI.NavMeshPath).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.AI.NavMeshQueryFilter filter = (UnityEngine.AI.NavMeshQueryFilter) typeof(UnityEngine.AI.NavMeshQueryFilter).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.Vector3 targetPosition = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            UnityEngine.Vector3 sourcePosition = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = UnityEngine.AI.NavMesh.CalculatePath(sourcePosition, targetPosition, filter, path);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
コード例 #8
0
        //returns the nearest portal of a container, based on the position
        static Vector3?FindNearest(Transform parent, Vector3 pos)
        {
            //initialize variables
            UnityEngine.AI.NavMeshPath path = new UnityEngine.AI.NavMeshPath();
            Vector3?nearest  = null;
            float   distance = Mathf.Infinity;

            //don't continue if the parent does not exist
            if (!portals.ContainsKey(parent))
            {
                return(null);
            }

            //loop over portals of this portal container,
            //find the shortest NavMesh path to a portal
            for (int i = 0; i < portals[parent].Count; i++)
            {
                Vector3 portal = portals[parent][i].position;
                float   length = Mathf.Infinity;
                //let Unity calculate the path and set length, if valid
                if (UnityEngine.AI.NavMesh.CalculatePath(pos, portal, -1, path) &&
                    path.status == UnityEngine.AI.NavMeshPathStatus.PathComplete)
                {
                    length = PathLength(path);
                }

                if (length < distance)
                {
                    distance = length;
                    nearest  = portal;
                }
            }

            return(nearest);
        }
コード例 #9
0
        protected override bool OnCheck()
        {
            var path = new UnityEngine.AI.NavMeshPath();

            agent.CalculatePath(targetPosition.value, path);
            savePathAs.value = path.corners.ToList();
            return(path.status == UnityEngine.AI.NavMeshPathStatus.PathComplete);
        }
コード例 #10
0
        public override Vector3[] GetPointsArray(Vector3 startPosition, Vector3 targetPosition, AC.Char _char = null)
        {
            UnityEngine.AI.NavMeshPath _path = new UnityEngine.AI.NavMeshPath();

            if (!UnityEngine.AI.NavMesh.CalculatePath(startPosition, targetPosition, -1, _path))
            {
                // Could not find path with current vectors
                float maxDistance  = 0.001f;
                float originalDist = Vector3.Distance(startPosition, targetPosition);

                UnityEngine.AI.NavMeshHit hit = new UnityEngine.AI.NavMeshHit();
                for (maxDistance = 0.001f; maxDistance < originalDist; maxDistance += 0.05f)
                {
                    if (UnityEngine.AI.NavMesh.SamplePosition(startPosition, out hit, maxDistance, -1))
                    {
                        startPosition = hit.position;
                        break;
                    }
                }

                bool foundNewEnd = false;
                for (maxDistance = 0.001f; maxDistance < originalDist; maxDistance += 0.05f)
                {
                    if (UnityEngine.AI.NavMesh.SamplePosition(targetPosition, out hit, maxDistance, -1))
                    {
                        targetPosition = hit.position;
                        foundNewEnd    = true;
                        break;
                    }
                }

                if (!foundNewEnd)
                {
                    return(new Vector3[0]);
                }

                UnityEngine.AI.NavMesh.CalculatePath(startPosition, targetPosition, -1, _path);
            }

            List <Vector3> pointArray = new List <Vector3>();

            foreach (Vector3 corner in _path.corners)
            {
                pointArray.Add(corner);
            }
            if (pointArray.Count > 1 && pointArray[0].x == startPosition.x && pointArray[0].z == startPosition.z)
            {
                pointArray.RemoveAt(0);
            }
            else if (pointArray.Count == 0)
            {
                pointArray.Clear();
                pointArray.Add(targetPosition);
            }

            return(pointArray.ToArray());
        }
コード例 #11
0
        static StackObject *Ctor_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *__ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new UnityEngine.AI.NavMeshPath();

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
コード例 #12
0
 void Start()
 {
     path    = new UnityEngine.AI.NavMeshPath();
     elapsed = 0.0f;
     if (goFrom == null)
     {
         goFrom = gameObject;
     }
 }
コード例 #13
0
 public override void SetMoveToPosition(AIBrain ai, ET.MoveType _moveType, ET.MoveToType _moveToType, bool _usePath = false, UnityEngine.AI.NavMeshPath _path = null)
 {
     moveType   = _moveType;
     moveToType = _moveToType;
     if (_usePath)
     {
         usePath = _usePath;
         path    = _path;
     }
 }
コード例 #14
0
ファイル: Navigator.cs プロジェクト: kurumsaleyup/GunRun
 public void Initiate(Transform transform)
 {
     this.transform     = transform;
     path               = new UnityEngine.AI.NavMeshPath();
     initiated          = true;
     cornerIndex        = 0;
     corners            = new Vector3[0];
     state              = State.Idle;
     lastTargetPosition = new Vector3(Mathf.Infinity, Mathf.Infinity, Mathf.Infinity);
 }
コード例 #15
0
        void SetLine(UnityEngine.AI.NavMeshPath path)
        {
            _pointList.Clear();
            for (int i = 0; i < path.corners.Length; i++)
            {
                _pointList.Add(path.corners[i]);
            }

            _lineId = PT_Game.Match.Widgets.ShowPath(_pointList, _lineId);
        }
コード例 #16
0
        void DoCalculatePath()
        {
            GameObject _sourceGameObject = Fsm.GetOwnerDefaultTarget(sourceGameObject);

            if (_sourceGameObject == null)
            {
                return;
            }
            GameObject _targetGameObject = targetGameObject.Value;

            if (_targetGameObject == null)
            {
                return;
            }

            _getNavMeshPathProxy();

            UnityEngine.AI.NavMeshPath _path = new UnityEngine.AI.NavMeshPath();

            bool _found = UnityEngine.AI.NavMesh.CalculatePath(_sourceGameObject.transform.position, _targetGameObject.transform.position, passableMask.Value, _path);

            if (_NavMeshPathProxy != null)
            {
                _NavMeshPathProxy.path = _path;
            }

            if (!calculatedPathCorners.IsNone)
            {
                calculatedPathCorners.Resize(_path.corners.Length);
                for (int i = 0; i < calculatedPathCorners.Length; i++)
                {
                    calculatedPathCorners.Set(i, _path.corners [i]);
                }

                calculatedPathCorners.SaveChanges();
            }

            resultingPathFound.Value = _found;

            if (_found)
            {
                if (!FsmEvent.IsNullOrEmpty(resultingPathFoundEvent))
                {
                    Fsm.Event(resultingPathFoundEvent);
                }
            }
            else
            {
                if (!FsmEvent.IsNullOrEmpty(resultingPathNotFoundEvent))
                {
                    Fsm.Event(resultingPathNotFoundEvent);
                }
            }
        }
コード例 #17
0
        /// <summary>
        /// initialize component
        /// </summary>
        public override void initialize()
        {
            base.initialize();
            m_path        = new UnityEngine.AI.NavMeshPath();
            m_CurrentDest = transform.position;
            enableMove    = true;

            // no looking to camera direction
            m_Character.setIKMode(TPCharacter.IKMode.None);
            lookTowardsCamera = false;
        }
コード例 #18
0
        public void DeserializeBeforeRef(UABUnpacker unpacker, UABField field, ref object value, List <ISerializer> serializers)
        {
            var data = new Data();

            unpacker.Deserialize(data, field.fields, serializers);
                        #if UNITY_5_5_OR_NEWER
            value = new UnityEngine.AI.NavMeshPath();
                        #else
            value = new UnityEngine.NavMeshPath();
                        #endif
        }
コード例 #19
0
        static int _g_get_status(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.AI.NavMeshPath gen_to_be_invoked = (UnityEngine.AI.NavMeshPath)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.status);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
コード例 #20
0
        public void Calculate()
        {
            if (hasTransforms)
            {
                UnityEngine.AI.NavMeshPath _navMeshPath = new UnityEngine.AI.NavMeshPath();
                float[] originalCost = StandardAreaCosts();
                if (areaCosts != null)
                {
                    SetAreaCosts(areaCosts);
                }

                if (calcFromHighest)
                {
                    RearangeHighest();

                    UnityEngine.AI.NavMesh.CalculatePath(highest.position, lowest.position, UnityEngine.AI.NavMesh.AllAreas, _navMeshPath);

                    if (_navMeshPath.status == UnityEngine.AI.NavMeshPathStatus.PathInvalid)
                    {
                        UnityEngine.AI.NavMesh.CalculatePath(highest.position, navMeshPath.corners[navMeshPath.corners.Length - 1], UnityEngine.AI.NavMesh.AllAreas, _navMeshPath);
                    }
                }
                else
                {
                    UnityEngine.AI.NavMesh.CalculatePath(origin.position, target.position, UnityEngine.AI.NavMesh.AllAreas, _navMeshPath);

                    if (_navMeshPath.status == UnityEngine.AI.NavMeshPathStatus.PathInvalid)
                    {
                        UnityEngine.AI.NavMesh.CalculatePath(origin.position, navMeshPath.corners[navMeshPath.corners.Length - 1], UnityEngine.AI.NavMesh.AllAreas, _navMeshPath);
                    }
                }

                if (_navMeshPath.status != UnityEngine.AI.NavMeshPathStatus.PathInvalid)
                {
                    CalcDistance();
                    navMeshPath = _navMeshPath;
                }

                if (areaCosts != null)
                {
                    SetAreaCosts(originalCost);
                }
            }
            else
            {
                lastActive += Time.deltaTime;

                if (lastActive >= 10f)
                {
                    Core.PathUpdater.RemovePath(origin, target);
                }
            }
        }
コード例 #21
0
        // -------------------------------------------------------------------------
        public override void OnEnable()
        // -------------------------------------------------------------------------
        {
            _path = new UnityEngine.AI.NavMeshPath();

            _who = _params[0] as MT_Combatant;
            if (!Dbg.Assert(_who != null))
            {
                _nma = _who.Pawn.GetComponent <UnityEngine.AI.NavMeshAgent>();
            }
            _done = false;
            base.OnEnable();
        }
コード例 #22
0
        private void Start()
        {
            // get the components on the object we need ( should not be null due to require component so no need to check )
            agent     = GetComponentInChildren <UnityEngine.AI.NavMeshAgent> ();
            character = GetComponent <ThirdPersonCharacter> ();

            agent.updateRotation = false;
            agent.updatePosition = true;

            path      = new UnityEngine.AI.NavMeshPath();
            elapsed   = 0.0f;
            reachable = TargetReachable();
        }
コード例 #23
0
        public void Init()
        {
            if (randomWaypoint == null)
            {
                randomWaypoint = new vFisherYatesRandom();
            }
            if (randomPatrolPoint == null)
            {
                randomPatrolPoint = new vFisherYatesRandom();
            }
            currentWaypoint    = -1;
            currentPatrolPoint = -1;
            fwd                  = transform.forward;
            destination          = transform.position;
            agent                = GetComponent <UnityEngine.AI.NavMeshAgent>();
            agent.updateRotation = false;
            agentPath            = new UnityEngine.AI.NavMeshPath();
            sphereSensor         = GetComponentInChildren <v_AISphereSensor>();
            if (sphereSensor)
            {
                sphereSensor.SetColliderRadius(maxDetectDistance);
            }
            animator     = GetComponent <Animator>();
            meleeManager = GetComponent <vMeleeManager>();
            canAttack    = true;
            attackCount  = 0;
            sideMovement = GetRandonSide();
            destination  = transform.position;

            _rigidbody             = GetComponent <Rigidbody>();
            _rigidbody.useGravity  = false;
            _rigidbody.isKinematic = false;
            _rigidbody.constraints = RigidbodyConstraints.None | RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionZ;
            _capsuleCollider       = GetComponent <CapsuleCollider>();

            healthSlider  = GetComponentInChildren <v_SpriteHealth>();
            head          = animator.GetBoneTransform(HumanBodyBones.Head);
            oldPosition   = transform.position;
            currentHealth = maxHealth;

            method = OffMeshLinkMoveMethod.Grounded;

            // set up Actions
            jumpOverLayer = UnityEngine.AI.NavMesh.GetAreaFromName("JumpOver");
            stepUpLayer   = UnityEngine.AI.NavMesh.GetAreaFromName("StepUp");
            climbUpLayer  = UnityEngine.AI.NavMesh.GetAreaFromName("ClimbUp");
            useJumpOver   = ActionIsEnabled(AIActions.JumpOver);
            useStepUp     = ActionIsEnabled(AIActions.StepUp);
            useClimbUp    = ActionIsEnabled(AIActions.ClimbUp);
            startPosition = transform.position;
        }
コード例 #24
0
                /// <summary>
                /// Constructor for setting up initial starting point and final destination.
                /// </summary>
                public PortalNode(PortalPath instance, Vector3 start)
                {
                    path       = instance;
                    this.start = start;

                    //initialize variables
                    UnityEngine.AI.NavMeshPath p = new UnityEngine.AI.NavMeshPath();
                    //let Unity calculate this path and set target, if valid
                    if (UnityEngine.AI.NavMesh.CalculatePath(start, instance.final, -1, p) &&
                        p.status == UnityEngine.AI.NavMeshPathStatus.PathComplete)
                    {
                        this.target = instance.final;
                    }
                }
コード例 #25
0
ファイル: AI.cs プロジェクト: scottbass47/gsts
        static float PathLength(UnityEngine.AI.NavMeshPath path)
        {
            float d = float.PositiveInfinity;

            if (path != null && path.corners.Length > 1)
            {
                d = 0.0f;
                for (int i = 0; i < path.corners.Length - 1; i++)
                {
                    var p0 = path.corners[i + 0];
                    var p1 = path.corners[i + 1];
                    d += Vector3.Distance(p1, p0);
                }
            }
            return(d);
        }
コード例 #26
0
 void OnDrawGizmos()
 {
     if (path == null)
     {
         path = new UnityEngine.AI.NavMeshPath();
     }
     if (goFrom == null)
     {
         goFrom = gameObject;
     }
     isReachable = UnityEngine.AI.NavMesh.CalculatePath(goFrom.transform.position, target.position, UnityEngine.AI.NavMesh.AllAreas, path);
     for (int i = 0; i < path.corners.Length - 1; i++)
     {
         Debug.DrawLine(path.corners[i], path.corners[i + 1], Color.red);
     }
 }
コード例 #27
0
ファイル: UBA.cs プロジェクト: MatejVitek/Intelligent-Agents
 // Calculate the distance between two points on the NavMesh
 // Returns Infinity if a valid navigation path cannot be found
 private static float GetDistance(Vector3 p1, Vector3 p2)
 {
     UnityEngine.AI.NavMeshPath path = new UnityEngine.AI.NavMeshPath();
     UnityEngine.AI.NavMeshHit hit;
     if (UnityEngine.AI.NavMesh.SamplePosition (p1, out hit, 1f, UnityEngine.AI.NavMesh.AllAreas))
         p1 = hit.position;
     if (UnityEngine.AI.NavMesh.SamplePosition (p2, out hit, 1f, UnityEngine.AI.NavMesh.AllAreas))
         p2 = hit.position;
     if (UnityEngine.AI.NavMesh.CalculatePath (p1, p2, UnityEngine.AI.NavMesh.AllAreas, path)) {
         float distance = 0f;
         for (int i = 1; i < path.corners.Length; i++)
             distance += Vector3.Distance (path.corners[i - 1], path.corners[i]);
         return distance;
     }
     return float.PositiveInfinity;
 }
コード例 #28
0
ファイル: EnemyWander.cs プロジェクト: chen13469990/Racing
        void GoToWaypoint()
        {
            UnityEngine.AI.NavMeshPath path = new UnityEngine.AI.NavMeshPath();
            Vector3 newLocation             = Vector3.zero;

            while (path.status == UnityEngine.AI.NavMeshPathStatus.PathPartial || path.status == UnityEngine.AI.NavMeshPathStatus.PathInvalid)
            {
                Vector3 ran = Random.insideUnitSphere * WanderRadius;
                ran.y       = _startingPos.y;
                newLocation = _startingPos + ran;
                _navMeshAgent.CalculatePath(newLocation, path);
            }
            _navMeshAgent.SetDestination(newLocation);

            _hasReachedDestination = false;
        }
コード例 #29
0
 public override void OnInit() {
     GameObject targetGameObject = (graph as AIGraph).GetVariable<GameObject>("targetObject");
     Collider c = targetGameObject.GetComponentInChildren<Collider>();
     Transform t = (graph as AIGraph).GetVariable<Transform>("transform");
     if (c.ClosestPoint(t.position) == t.position) {
         alreadyInside = true;
         return;
     }
     pathNode = 0;
     if (path == null) {
         path = new UnityEngine.AI.NavMeshPath();
     }
     UnityEngine.AI.NavMesh.CalculatePath(t.position, targetGameObject.transform.position, UnityEngine.AI.NavMesh.AllAreas, path);
     (graph as AIGraph).SetVariable("UpdateDelay", 0.1f);
     giveUpTimer = Time.timeSinceLevelLoad + giveUpTime;
     recalculateTimer = Time.timeSinceLevelLoad + recalculateTime;
 }
コード例 #30
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    UnityEngine.AI.NavMeshPath gen_ret = new UnityEngine.AI.NavMeshPath();
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.AI.NavMeshPath constructor!"));
        }
        void DoCalculatePath()
        {
            GameObject _sourceGameObject = Fsm.GetOwnerDefaultTarget(sourceGameObject);

            if (_sourceGameObject == null)
            {
                return;
            }
            GameObject _targetGameObject = targetGameObject.Value;

            if (_targetGameObject == null)
            {
                return;
            }


            _getNavMeshPathProxy();
            if (_NavMeshPathProxy == null)
            {
                return;
            }

            UnityEngine.AI.NavMeshPath _path = new UnityEngine.AI.NavMeshPath();

            bool _found = UnityEngine.AI.NavMesh.CalculatePath(_sourceGameObject.transform.position, _targetGameObject.transform.position, passableMask.Value, _path);

            _NavMeshPathProxy.path = _path;

            resultingPathFound.Value = _found;

            if (_found)
            {
                if (!FsmEvent.IsNullOrEmpty(resultingPathFoundEvent))
                {
                    Fsm.Event(resultingPathFoundEvent);
                }
            }
            else
            {
                if (!FsmEvent.IsNullOrEmpty(resultingPathNotFoundEvent))
                {
                    Fsm.Event(resultingPathNotFoundEvent);
                }
            }
        }