Commit 0cb1a22a authored by 18손재민's avatar 18손재민

맵 불러올때마다 바닥 좌표 계속 초기화하던거 수정

parent 0ea6b148
......@@ -199,34 +199,16 @@ public class Map : MonoBehaviour
Debug.Log("Wall doesn't exists between : " + floor1.mapPos + ", " + floor2.mapPos);
}
private void LoadObjects()
{
for(int i = 0; i < floors.transform.childCount; i++)
{
Floor floor = floors.transform.GetChild(i).GetComponent<Floor>();
floorGrid.Add(floor.mapPos, floor);
}
for (int i = 0; i < walls.transform.childCount; i++)
{
Wall wall = walls.transform.GetChild(i).GetComponent<Wall>();
wallGrid.Add(wall.mapPos, wall);
}
}
public void InitiateMap()
{
floorGrid = new Dictionary<Vector2Int, Floor>();
wallGrid = new Dictionary<Vector2, Wall>();
startFloors = new List<Floor>();
//LoadObjects();
}
private void Awake()
{
/*floorGrid = new Dictionary<Vector2Int, Floor>();
wallGrid = new Dictionary<Vector2, Wall>();
startFloors = new List<Floor>();
LoadObjects();*/
}
// Start is called before the first frame update
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment