Exemplo n.º 1
0
        public void Move(Vector2 destination)
        {
            movementController.StartMovement(destination);

            if (pathSegmentsPassed == path.Count)
            {
                path.Add(destination);
            }
            ++pathSegmentsPassed;
        }
Exemplo n.º 2
0
        public override void ExecuteNextMove()
        {
            List <Field> path = Utilities.PathFinding.AStar(Game.Instance.CurrentLevel.Grid[transform.position], Game.Instance.CurrentLevel.Grid[targetPosition], Utilities.PathFinding.EmptyHeuristic);

            if (path.Count > 1)
            {
                Debug.Log(path[1].transform.position);
                movementController.StartMovement(path[1].transform.position);
            }
        }