Beispiel #1
0
        public void MoveTo(Vector2 tile)
        {
            //TODO: pathfinding
            List <Vector2> path = GetDummyPath();

            movement.Move(path);
        }
Beispiel #2
0
 public void MoveTo(Vector2 tile)
 {
     PathFind.Point _from = new PathFind.Point(0, 0);
     PathFind.Point _to   = new PathFind.Point(5, 5);
     path = PathFind.Pathfinding.FindPath(grid, _from, _to);
     MakeVector();
     movement.Move(pathinvector);
 }
Beispiel #3
0
        public void MoveTo(Vector2 tile, Action onFinish)
        {
            //TODO: pathfinding
            Vector2 myPosition = new Vector2(Mathf.Round(transform.position.x), Mathf.Round(transform.position.y));

            QuitPosition(myPosition);

            List <Vector2> path = new List <Vector2> ();

            path = pathFinding.PathFinding(myPosition, tile);

            movement.Move(path);

            StartCoroutine(WaitForMoveCompleted(onFinish));
        }
Beispiel #4
0
        public void MoveTo(Vector2 tile, Action onFinish)
        {
            //TODO: pathfinding
            if (anim != null)
            {
                sonidoCaminar.Play();
            }
            Vector2 myPosition = new Vector2(Mathf.Round(transform.position.x), Mathf.Round(transform.position.y));

            QuitPosition(myPosition);

            List <Vector2> path = new List <Vector2> ();

            path = pathFinding.PathFinding(myPosition, tile);

            if (path.Count <= 0)
            {
                onFinish();
                return;
            }
            movement.Move(path);

            StartCoroutine(WaitForMoveCompleted(onFinish));
        }