private DungeonData.Direction GetFacingDirection(IntVector2 pos1, IntVector2 pos2) { DungeonData data = GameManager.Instance.Dungeon.data; if (data.isWall(pos1 + IntVector2.Down) && data.isWall(pos1 + IntVector2.Up)) { return(DungeonData.Direction.EAST); } if (data.isWall(pos2 + IntVector2.Down) && data.isWall(pos2 + IntVector2.Up)) { return(DungeonData.Direction.WEST); } if (data.isWall(pos1 + IntVector2.Down) && data.isWall(pos2 + IntVector2.Down)) { return(DungeonData.Direction.NORTH); } if (data.isWall(pos1 + IntVector2.Up) && data.isWall(pos2 + IntVector2.Up)) { return(DungeonData.Direction.SOUTH); } Debug.LogError("Not able to determine the direction of a wall mimic! Using random direction instead!"); // return DungeonData.Direction.SOUTH; return(BraveUtility.RandomElement(new List <DungeonData.Direction>() { DungeonData.Direction.EAST, DungeonData.Direction.WEST, DungeonData.Direction.NORTH, DungeonData.Direction.SOUTH } )); }