void Around() { state = NavPathState.Around; navMeshAgent.obstacleAvoidanceType = ObstacleAvoidanceType.HighQualityObstacleAvoidance; navMeshAgent.SetDestination(to.position); toUnitData.aroundList.Add(unitData); }
void Move() { state = NavPathState.Moveing; navMeshAgent.enabled = true; navMeshAgent.speed = unitData.moveSpeed; navMeshAgent.obstacleAvoidanceType = ObstacleAvoidanceType.HighQualityObstacleAvoidance; navMeshAgent.SetDestination(endTarget); }
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)); }
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)); }