bool AddOption(string winName, string opText) { string icon; string name; int num; FuBenConfig op = new FuBenConfig(); // 加入文字转义 string parseRes; parseRes = UIString.Instance.ParserString_Runtime(opText); UIString.Instance.ParseFuBen(parseRes, out icon, out name, out num); op.IconName = icon; op.FuBenName = name; op.StarNum = num; op.WinName = winName; allWindows.Add(op); return(true); }
void ReLayout() { int nCount = 0; bool bResetSelectIndex = true; int nBeginIndex = mCurrentPage * MAX_EQUIPGRID; for (int i = 0; i < allWindows.Count; i++) { FuBenConfig item = allWindows[i]; if (item != null) { if (nCount < nBeginIndex || nCount - nBeginIndex >= MAX_EQUIPGRID) { nCount++; continue; } //不重置当前选择的索引 //if (nCount - nBeginIndex >= mCurrentSelectedEquip) //if(mCurrentPage == mCurrentSelectedEquip/MAX_EQUIPGRID) // bResetSelectIndex = false; mFuBenIcons[nCount - nBeginIndex].SetIcon(item.IconName); mFuBenNames[nCount - nBeginIndex].Text = item.FuBenName; mFuBenIcons[nCount - nBeginIndex].gameObject.name = item.WinName; nCount++; } } //if (bResetSelectIndex) //{ // for(int i = 0; i < MAX_EQUIPGRID; i++) // mFuBenBgs[i].Hide(true); //} mMaxPage = nCount / MAX_EQUIPGRID; if (nCount % MAX_EQUIPGRID != 0) { mMaxPage++; } UpatePageNum(); HideItem(); }