Exemple #1
0
 void Around()
 {
     state = NavPathState.Around;
     navMeshAgent.obstacleAvoidanceType = ObstacleAvoidanceType.HighQualityObstacleAvoidance;
     navMeshAgent.SetDestination(to.position);
     toUnitData.aroundList.Add(unitData);
 }
Exemple #2
0
 void Move()
 {
     state = NavPathState.Moveing;
     navMeshAgent.enabled = true;
     navMeshAgent.speed   = unitData.moveSpeed;
     navMeshAgent.obstacleAvoidanceType = ObstacleAvoidanceType.HighQualityObstacleAvoidance;
     navMeshAgent.SetDestination(endTarget);
 }
Exemple #3
0
        void Out()
        {
            state = NavPathState.Outing;
            navMeshAgent.enabled = true;
            navMeshAgent.speed   = unitData.moveSpeed;
            navMeshAgent.obstacleAvoidanceType = ObstacleAvoidanceType.NoObstacleAvoidance;
            navMeshAgent.SetDestination(begionTarget);

//			iTween.MoveTo(gameObject,iTween.Hash("islocal", false, "position", begionTarget,"time", (unitData.moveSpeed > 0 ? beginDistance / unitData.moveSpeed * 3f : 2F),
//			                                     "oncomplete", "OnOutComplete", "oncompletetarget", gameObject));
        }
Exemple #4
0
        public void In()
        {
            if (toUnitData.aroundList.Contains(unitData))
            {
                toUnitData.aroundList.Remove(unitData);
            }

            state = NavPathState.Ining;
            navMeshAgent.obstacleAvoidanceType = ObstacleAvoidanceType.NoObstacleAvoidance;
            navMeshAgent.SetDestination(to.position);
//			navMeshAgent.enabled = false;
//			iTween.MoveTo(gameObject,iTween.Hash("islocal", false, "position", to.position,"time", (unitData.moveSpeed > 0 ? endDistance / unitData.moveSpeed : 2F),
//			                                     "oncomplete", "OnOInComplete", "oncompletetarget", gameObject));
        }