public void ShowWord(WordVO wordVO) { if (wordVO == null) { labelSpell.text = "无"; labelAlreadyLearn.text = "无"; labelExplain.text = "暂无"; labelImportant.text = "无"; labelCount.text = "无"; } else { labelSpell.text = wordVO.Spell; labelAlreadyLearn.text = wordVO.IsAlreadyLearn ? "已学会":"未学会"; labelExplain.text = "暂无"; labelImportant.text = wordVO.Count < m_lThreshold ? "不重要" : "重要"; labelCount.text = string.Format("次数:{0}" + (wordVO.Count <= 0 ? "(没有添加记录)" : ""), wordVO.Count); } Util.RefreshListGameObjectCount <UI_Context>(m_listContexts, wordVO != null ? wordVO.Contexts.Count : 0, objContextTemplate, delegate(int iIndex, UI_Context obj) { obj.transform.SetParent(contextContainer.transform); obj.action = OnEditorContext; }); for (int i = 0; i < wordVO.Contexts.Count; i++) { m_listContexts[i].SetContextInfo(i + 1, wordVO.Contexts[i]); } }
private void SearchWord() { string strSearchWord = uiWordDesc.GetSearchWord(); if (strSearchWord == null || strSearchWord == "") { curWordVO = null; } else { curWordVO = bookMgr.GetWord(strSearchWord); uiWordDesc.CleanSearchWord(); } uiWordDesc.ShowWord(curWordVO); }
//Default Sort Func private static int sortWithWordCount(WordVO word1, WordVO word2) { if (word1.Count > word2.Count) { return(-1); } else if (word1.Count == word2.Count) { return(0); } else { return(1); } }
public void ShowWorld(string strWord) { curWordVO = bookMgr.GetWord(strWord); uiWordDesc.ShowWord(curWordVO); }