/// <summary> /// 更新选中房间信息。 /// </summary> public void UpdataCheckRoomInfo(LAMapData.Room pRoom) { if (pRoom != null) { m_pRoomShow.UpdataCheckRoomInfo(pRoom); ShowPlay(pRoom.m_bOpenLock); } }
/// <summary> /// 更新选中房间信息。 /// </summary> public void UpdataCheckRoomInfo(LAMapData.Room pRoom) { if (pRoom != null) { m_pId.text = pRoom.m_nId + ""; ShowMapLevel(pRoom.m_nCheckLv, true); ShowScore(pRoom.m_nMaxScore); CloseLeftOrRightBtn(pRoom.m_nCheckLv, pRoom.m_nMaxLv); } }
/// <summary> /// 单击房间左右难度。 /// </summary> /// <param name="b"></param> public void RoomShowOnClickLeftAndRightMapLevel(bool b, Action <int, int> pBack) { LAMapData.Room Room = GetCheckRoom(); if (!b) { Room.m_nCheckLv++; } else if (b) { Room.m_nCheckLv--; } pBack(Room.m_nCheckLv, Room.m_nMaxLv); }
/// <summary> /// 填充数据。 /// </summary> public void FillData(LAMapData.Room pRoomData) { m_pName.gameObject.SetActive(pRoomData.m_bOpenLock); m_pLock.SetActive(!pRoomData.m_bOpenLock); m_pImage.sprite = null; m_pName.text = pRoomData.m_pName; LAMapData.Room Room = pRoomData; m_pName.GetComponent <Button>().onClick.RemoveAllListeners(); m_pLock.GetComponent <Button>().onClick.RemoveAllListeners(); m_pName.GetComponent <Button>().onClick.AddListener(delegate() { OnClickRoomItem(Room); }); m_pLock.GetComponent <Button>().onClick.AddListener(delegate() { OnClickRoomItem(Room); }); }
/// <summary> /// 单击房间项目。 /// </summary> /// <param name="pRoom"></param> private void OnClickRoomItem(LAMapData.Room pRoom) { if (pRoom != null) { if (pRoom != LAClient.g_Ins.GetCheckRoom()) { if (m_pMapLevelAnim != null) { if (!m_pMapLevelAnim.IsPlaying()) { OnClickRoomAction(pRoom); } } else { OnClickRoomAction(pRoom); } } } }
/// <summary> /// 填充所有地图数据。 /// </summary> public void FillMapData() { List <Map> lReMaps = MapData.Maps; LAMapData lMapDatas = new LAMapData(); // 填充假数据。 for (int i = 0; i < lReMaps.Count; i++) { LAMapData.Room Item = new LAMapData.Room(); Item.m_nId = lReMaps[i].id; Item.m_pName = "关卡" + lReMaps[i].id; Item.m_pRoomId = "room" + lReMaps[i].id; Item.m_nMaxScore = lReMaps[i].bestScore; Item.m_nMaxLv = m_pLAMapData.MaxLvEnumTransInt(lReMaps[i].mapLevel); Item.m_nCheckLv = Item.m_nMaxLv; Item.m_bOpenLock = !lReMaps[i].isLock; lMapDatas.m_lRooms.Add(Item); } m_pLAMapData.FillMapData(lMapDatas); }
/// <summary> /// 单击房间项目。 /// </summary> /// <param name="pRoom"></param> private void OnClickRoomItem(LAMapData.Room pRoom) { OnClickRoomAction(pRoom); }
/// <summary> /// 设置选中房间。 /// </summary> /// <param name="pRoom"></param> public void SetCheckRoom(LAMapData.Room pRoom) { m_pRoom = pRoom; }
/// <summary> /// 单击房间项目。 /// </summary> /// <param name="pRoom"></param> private void RoomShowOnClickRoomItem(LAMapData.Room pRoom) { SetCheckRoom(pRoom); m_pUILoadingView.UpdataCheckRoomInfo(pRoom); }