public StageDetailInfo LookUp(int id) { StageDetailInfo info = null; if (m_map.TryGetValue(id, out info)) { return(info); } return(null); }
public void Load(byte[] bytes) { m_map = new Dictionary <int, StageDetailInfo>(); BinaryHelper helper = new BinaryHelper(bytes); int sceneCount = helper.ReadInt(); for (int index = 0; index < sceneCount; ++index) { StageDetailInfo info = new StageDetailInfo(); info.Load(helper); m_map.Add(info.m_id, info); } }
public void Update(int stageID) { StageDetailInfo stageInfo = GameTable.StageInfoTableAsset.LookUp(stageID); if (null == stageInfo) { return; } m_require.text = Localization.Get("RequireLevel") + stageInfo.m_requireLevel; m_stageName.text = "" + stageInfo.m_name; string strTag = Localization.Get("New"); //if (ActorManager.Singleton.MainActor.m_curStageId > stageId) { strTag = Localization.Get("Clear"); } m_tag.text = strTag; }
// 显示floor void UpdateFloorInfo(int stageId) { m_heleperBar.value = 0; StageMenu.Singleton.m_curStageId = stageId; StageDetailInfo stageDetailInfo = GameTable.StageInfoTableAsset.LookUp(stageId); if (null == stageDetailInfo) { return; } m_name.text = stageDetailInfo.m_name; List <int> floorList = new List <int>(); foreach (int floorId in stageDetailInfo.m_floorList) { floorList.Add(floorId); } foreach (UIStageMenuFloorItem item in m_floorItemList) { item.Destroy(); } m_floorItemList.Clear(); int pos = 0; for (int i = floorList.Count - 1; i >= 0; i--) { int floorId = floorList[i]; UIStageMenuFloorItem floorItem = UIStageMenuFloorItem.Create(); // 设置 父物体 floorItem.SetParent(m_grid.transform); // 设置名称 floorItem.WindowRoot.transform.name = floorList[i].ToString(); floorItem.Update(floorId); UIEventListener.Get(floorItem.WindowRoot.gameObject).onClick = OnChooseFloor; m_floorItemList.Add(floorItem); floorItem.WindowRoot.transform.LocalPositionX(600f); floorItem.WindowRoot.transform.LocalPositionY(pos * (-66.3f)); floorItem.WindowRoot.transform.LocalPositionZ(0f); TweenPosition temp = floorItem.WindowRoot.transform.GetComponent <TweenPosition>(); if (null == temp) { continue; } temp.delay = 0.03f * pos; Vector3 posV = floorItem.WindowRoot.transform.localPosition; posV.x = 0; TweenPosition.Begin(floorItem.WindowRoot, 0.5f, posV).method = UITweener.Method.EaseIn; pos++; } m_curType = (int)CurType.enFloorType; RefreshJoystickAutoMap(); }