public void RoomFlagCtrl(CGlobal.ERoomType roomType) { _noRoomFlag = false; switch (roomType) { case CGlobal.ERoomType._event: _roomTypeFlag = CGlobal.ERoomType._event; break; case CGlobal.ERoomType._itemElite: _roomTypeFlag = CGlobal.ERoomType._itemElite; break; case CGlobal.ERoomType._normal: _roomTypeFlag = CGlobal.ERoomType._normal; break; case CGlobal.ERoomType._shop: _roomTypeFlag = CGlobal.ERoomType._shop; break; case CGlobal.ERoomType._skillElite: _roomTypeFlag = CGlobal.ERoomType._skillElite; break; } }
private void InstantiateRoom(CGlobal.ERoomType roomType) { GameObject tempRoom; switch (roomType) { case CGlobal.ERoomType._start: tempRoom = Object.Instantiate(startRoom, startRoom.transform.position, startRoom.transform.rotation); _rooms.AddLast(tempRoom); break; case CGlobal.ERoomType._boss: tempRoom = Object.Instantiate(bossRoom, bossRoom.transform.position, bossRoom.transform.rotation); _rooms.AddLast(tempRoom); break; case CGlobal.ERoomType._event: tempRoom = eventRoomQueue.Dequeue(); tempRoom = Object.Instantiate(tempRoom, tempRoom.transform.position, tempRoom.transform.rotation); _rooms.AddLast(tempRoom); break; case CGlobal.ERoomType._itemElite: tempRoom = itemEliteRoomQueue.Dequeue(); tempRoom = Object.Instantiate(tempRoom, tempRoom.transform.position, tempRoom.transform.rotation); _rooms.AddLast(tempRoom); break; case CGlobal.ERoomType._normal: tempRoom = normalRoomQueue.Dequeue(); tempRoom = Object.Instantiate(tempRoom, tempRoom.transform.position, tempRoom.transform.rotation); _rooms.AddLast(tempRoom); break; case CGlobal.ERoomType._shop: tempRoom = Object.Instantiate(shopRoom, shopRoom.transform.position, shopRoom.transform.rotation); _rooms.AddLast(tempRoom); break; case CGlobal.ERoomType._skillElite: tempRoom = skillEliteRoomQueue.Dequeue(); tempRoom = Object.Instantiate(tempRoom, tempRoom.transform.position, tempRoom.transform.rotation); _rooms.AddLast(tempRoom); break; case CGlobal.ERoomType._empty: Debug.Log("Can't create empty room error"); return; } AddPortal(); NotifyPortal(); _roomCount++; }
private int _portalMomCount; //포탈맘 사용할때 태그를 이용해서 오브젝트를 받아오는데, 이 때 사라져야할 전방 포탈들도 가져와서 전 방 포탈들을 따로 하드코딩으로 제외하기 위한 변수 #endregion private void Start() { startRoom = Resources.Load("Room/StartRoom0") as GameObject; bossRoom = Resources.Load("Room/BossRoom0") as GameObject; shopRoom = Resources.Load("Room/ShopRoom0") as GameObject; _portals = new List <CPortal>(); if (instance == null) { instance = this; } _stageNumber = 0; _skillEliteCount = 0; _eventCount = 0; _shopCount = 0; _noRoomFlag = true; _roomTypeFlag = CGlobal.ERoomType._empty; _roomCount = 0; //방의 개수가 12개가 넘어가면 멈춰줄 변수 _portalMomCount = 0; _roomArr = new CRoom[CConstants.ROOM_PER_STAGE, CConstants.MAX_ROAD]; for (int i = 0; i < CConstants.ROOM_PER_STAGE; i++) { for (int j = 0; j < CConstants.MAX_ROAD; j++) { _roomArr[i, j] = new CRoom(); } } _rooms = new LinkedList <GameObject>(); RandomRoomEnqueue(); CreateStage(); }