movement anim
This commit is contained in:
parent
b7562d53ae
commit
5776d5e889
4 changed files with 114 additions and 54 deletions
|
|
@ -22,7 +22,7 @@ public class EnemyMovement : MonoBehaviour
|
|||
private HashSet<TileObject> visited = new();
|
||||
private Dictionary<TileObject, TileObject> currentPaths = new();
|
||||
|
||||
public void PathfindToTarget(TileObject target, Enemy selectedEntity)
|
||||
public void PathfindToTarget(TileObject target, Entity selectedEntity)
|
||||
{
|
||||
frontier.Clear();
|
||||
visited.Clear();
|
||||
|
|
@ -32,7 +32,7 @@ public class EnemyMovement : MonoBehaviour
|
|||
selectedEntity.currentTile = requestedTile;
|
||||
selectedEntity.transform.position = requestedTile.transform.position;
|
||||
}
|
||||
private void GetTilesInRange(Enemy selectedEntity)
|
||||
private void GetTilesInRange(Entity selectedEntity)
|
||||
{
|
||||
frontier.Enqueue(selectedEntity.currentTile);
|
||||
while (frontier.Count > 0)
|
||||
|
|
@ -51,7 +51,7 @@ public class EnemyMovement : MonoBehaviour
|
|||
Debug.Log(frontier.Count);
|
||||
}
|
||||
|
||||
private TileObject GetPathToTarget(TileObject target, Enemy selectedEntity)
|
||||
private TileObject GetPathToTarget(TileObject target, Entity selectedEntity)
|
||||
{
|
||||
TileObject currentTile = target;
|
||||
List<TileObject> pathToTarget = new();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue