Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<Tile> GetWalkableNodes()
- {
- Debug.Log("this is " + this.transform.name);
- List<Tile> walkable = new List<Tile>();
- foreach (KeyValuePair<Direction, Tile> hashMap in connection)
- {
- if (hashMap.Value != null)
- {
- //if it is walkable and is not occupied
- if (hashMap.Value.isWalkable)
- {
- Debug.Log("walkable node :"+hashMap.Value.transform.name);
- Debug.Log("direction: "+hashMap.Key.ToString());
- walkable.Add(hashMap.Value);
- }
- }
- }
- Debug.Log(walkable.Count);
- return walkable;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement