public void SetUseChip(int nIndex, ChipData chipData) { USECHIPS useTmp = new USECHIPS(chipData, m_useChips[nIndex].nKeys); m_useChips [nIndex] = useTmp; }
public void SelectChip(int nIndex) { if (nIndex >= m_listChips.Count) { return; } if (m_useChips.Count > 4) { return; } if (m_listChips [nIndex].bSelected == true) { return; } UIMgr.Inst.SetImageChips(m_arChipImg[m_listChips[nIndex].nImgResourceID][m_listChips[nIndex].nImgID]); USECHIPS useChips = new USECHIPS(m_listChips[nIndex], nIndex); m_useChips.Insert(m_useChips.Count, useChips); UIMgr.Inst.GetSelectedIcons(m_useChips.Count - 1).sprite = m_arIcon [(m_useChips[m_useChips.Count - 1].chipData.nIconID)]; int nValue = m_useChips [m_useChips.Count - 1].chipData.nValue; string szValue = " "; if (nValue != -1 && nValue != 0) { szValue = nValue.ToString(); } UIMgr.Inst.GetSelectChipText().text = m_useChips[m_useChips.Count - 1].chipData.szName + " " + szValue; SetListChipbSelect(nIndex, true); UIMgr.Inst.GetImageIcon() [nIndex].color = Color.gray; if (m_listChips[nIndex].cCode != '*') { int nCount = 10; if (m_listChips.Count < nCount) { nCount = m_listChips.Count; } for (int i = 0; i < nCount; i++) { if (m_listChips[i].bSelected == false) { if (m_listChips [i].cCode == m_listChips [nIndex].cCode) { continue; } else if (m_listChips[i].cCode == '*') { continue; } else { if (m_listChips[i].nID != m_listChips[nIndex].nID) { SetListChipbSelect(i, true); UIMgr.Inst.GetImageIcon() [i].color = Color.gray; } } } } } if (m_useChips.Count > 4) { for (int i = 0; i < 5; i++) { UIMgr.Inst.GetImageIcon() [i].color = Color.gray; } } }