void Refresh(TableState state) { if (mTableState != state) { mTableState = state; if (SkillTreeInfo.SkillMainTypeInfo.ContainsKey(pageIndex)) { mSkillTypeDatas.Clear(); // int count = 0; for (int i = 0; i < SkillTreeInfo.SkillMainTypeInfo[pageIndex].Count; i++) { int main_type = SkillTreeInfo.SkillMainTypeInfo[pageIndex][i]._mainType; SkillMainType mainType = SkillTreeInfo.SkillMainTypeInfo[pageIndex].Find(itr => itr._mainType == main_type); UISkillType.SkillTypeData skillTypeData = new UISkillType.SkillTypeData(SkillTreeInfo.GetUIShowList(mainType._mainType, skillMgr), mainType); mSkillTypeDatas.Add(skillTypeData); } mSkillTypeCtrl.SetContent(SkillTreeInfo.SkillMainTypeInfo[pageIndex].Count, OnSetSkillTypeBtnContent); mSkillTypeCtrl.SetActiveBtn(0); } } UpdateSkillTypePos(); }
void RefreshTypeData(int maintype) { int index = mSkillTypeDatas.FindIndex(itr => itr.info._mainType == maintype); if (index != -1) { mSkillTypeDatas[index].data = SkillTreeInfo.GetUIShowList(maintype, skillMgr); } if (mActiveSkillType != null) { SkillMainType mainType = SkillTreeInfo.SkillMainTypeInfo[pageIndex].Find(itr => itr._mainType == mActiveSkillType.data.info._mainType); if (mainType != null) { UISkillType.SkillTypeData skillTypeData = new UISkillType.SkillTypeData(SkillTreeInfo.GetUIShowList(mainType._mainType, skillMgr), mainType); mActiveSkillType.data = skillTypeData; } } if (onRefreshTypeData != null) { onRefreshTypeData(this); } }
void RefreshData() { if (!SkillTreeInfo.SkillMainTypeInfo.ContainsKey(pageIndex) || skillMgr == null) { return; } foreach (UISkillType uiType in mSkillTypeList) { SkillMainType mainType = SkillTreeInfo.SkillMainTypeInfo[pageIndex].Find(itr => itr._mainType == uiType.mainType); if (mainType == null) { continue; } UISkillType.SkillTypeData skillTypeData = new UISkillType.SkillTypeData(SkillTreeInfo.GetUIShowList(mainType._mainType, skillMgr), mainType); uiType.data = skillTypeData; } }
public void RefreshData(UISkillType.SkillTypeData data) { if (data == null) { return; } if (data.data.Count > 3 || data.data.Count == 0) { return; } foreach (UISkillItem item in mSkillItems) { if (data.data.ContainsKey(item.grade)) { if (item.index < data.data[item.grade].Count) { item.data = data.data[item.grade][item.index]; } } } }