private void UpdateInvestmentCell(GameObject go, int index) { if (updateNum - currentUpdateNum != 1) { for (int i = 10 * index + 1; i < 10 * (index + 1); i++) { var tmpObj = go.CloneEx(); tmpObj.transform.SetParent(go.transform.parent); tmpObj.transform.localPosition = go.transform.localPosition; tmpObj.transform.localScale = Vector3.one; var cell = new UIConclusionWindowCell(tmpObj); cell.RefreshInvestment(innerInvestmentAllList[i]); cell.setBoolInit(); cell.m_bool_Investment = true; cellObj.Add(tmpObj); } } else { for (int i = 10 * index + 1; i < (10 * index) + remainder; i++) { var tmpObj = go.CloneEx(); tmpObj.transform.SetParent(go.transform.parent); tmpObj.transform.localPosition = go.transform.localPosition; tmpObj.transform.localScale = Vector3.one; var cell = new UIConclusionWindowCell(tmpObj); cell.RefreshInvestment(innerInvestmentAllList[i]); cell.setBoolInit(); cell.m_bool_Investment = true; cellObj.Add(tmpObj); } } }
void _createCurrentInvestmentCell(GameObject go) { cellDestory(); innerInvestmentAllList = CardManager.Instance.innerInvestmentAllList; foreach (Investment r in innerInvestmentAllList) { foreach (int i in CardManager.Instance.investmentIDList) { if (i == r.id) { currentInvestmentList.Add(r); } } } if (currentInvestmentList.Count == 0) { _objItem.SetActiveEx(false); } else { for (int i = 0; i < currentInvestmentList.Count; i++) { if (i == 0) { var cell = new UIConclusionWindowCell(go); cell.RefreshInvestment(currentInvestmentList[i]); cell.setBoolInit(); cell.m_bool_Investment = true; } else { var tmpObj = go.CloneEx(); tmpObj.transform.SetParent(go.transform.parent); tmpObj.transform.localPosition = go.transform.localPosition; tmpObj.transform.localScale = Vector3.one; var cell = new UIConclusionWindowCell(tmpObj); cell.RefreshInvestment(currentInvestmentList[i]); cell.setBoolInit(); cell.m_bool_Investment = true; cellObj.Add(tmpObj); } } } }
private void _createInvestmentCell(GameObject go) { cellDestory(); innerInvestmentAllList = CardManager.Instance.innerInvestmentAllList; listNum = innerInvestmentAllList.Count / divisor; if (outerRiskAllList.Count % divisor != 0) { updateNum = listNum + 1; remainder = innerInvestmentAllList.Count % divisor; } else { updateNum = listNum; remainder = innerInvestmentAllList.Count % divisor; } for (int i = 0; i < 10; i++) { if (i == 0) { var cell = new UIConclusionWindowCell(go); cell.RefreshInvestment(innerInvestmentAllList[i]); cell.setBoolInit(); cell.m_bool_Investment = true; } else { var tmpObj = go.CloneEx(); tmpObj.transform.SetParent(go.transform.parent); tmpObj.transform.localPosition = go.transform.localPosition; tmpObj.transform.localScale = Vector3.one; var cell = new UIConclusionWindowCell(tmpObj); cell.RefreshInvestment(innerInvestmentAllList[i]); cell.setBoolInit(); cell.m_bool_Investment = true; cellObj.Add(tmpObj); } } }