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

            movement.Move(path);
        }
コード例 #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);
 }
コード例 #3
0
ファイル: Character.cs プロジェクト: johnnychip/Tiles_Tactics
        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));
        }
コード例 #4
0
ファイル: Character.cs プロジェクト: Maggot94/Practica1
        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));
        }