Exemplo n.º 1
0
    internal void AttemptMove(DungeonTile target)
    {
        DungeonManager.instance.Wait();
        List <DungeonTile> tempPath = DungeonManager.instance.grid.FindPath(myTile, target, movesLeft, IsFlying());

        if (tempPath[tempPath.Count - 1] == target && !target.isOccupied)
        {
            myTile.Vacate(this);
            target.Occupy(this);
            movePath    = tempPath;
            movesLeft  -= (movePath.Count - 1);
            isAnimating = true;
        }
        else
        {
            movePath = new List <DungeonTile>();
            movePath.Add(myTile);
            isAnimating = true;
            if (GetComponent <EnemyProgram>())
            {
                GetComponent <EnemyProgram>().BeginSearch();
            }
        }
    }