public void MoveTo(Vector2 tile) { //TODO: pathfinding List <Vector2> path = GetDummyPath(); movement.Move(path); }
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); }
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)); }
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)); }