public void UpdateBehaviour() { enemy.Position = Vector2.MoveTowards(enemy.Position, destination.position, enemy.Speed * Time.deltaTime); if (Vector2.Distance(destination.position, enemy.Position) < 0.05f) { destination = GameManager.I.GetDestination(++waypointIndex); if (destination == null) { enemy.EndPointReached(); } } }