Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1.  public List<Tile> GetWalkableNodes()
  2.     {
  3.         Debug.Log("this is " + this.transform.name);
  4.         List<Tile> walkable = new List<Tile>();
  5.         foreach (KeyValuePair<Direction, Tile> hashMap in connection)
  6.         {
  7.             if (hashMap.Value != null)
  8.             {
  9.                 //if it is walkable and is not occupied
  10.                 if (hashMap.Value.isWalkable)
  11.                 {
  12.                     Debug.Log("walkable node :"+hashMap.Value.transform.name);
  13.                     Debug.Log("direction: "+hashMap.Key.ToString());
  14.                     walkable.Add(hashMap.Value);
  15.                 }
  16.             }
  17.         }
  18.         Debug.Log(walkable.Count);
  19.         return walkable;
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement