private void UpdateOuterOpportunityCell(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.RefreshOuterOpportunity(outerOpportunityAllList[i]); cell.setBoolInit(); cell.m_bool_Big = 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.RefreshOuterOpportunity(outerOpportunityAllList[i]); cell.setBoolInit(); cell.m_bool_Big = true; cellObj.Add(tmpObj); } } }
void _createCurrentOpportunityCell(GameObject go) { cellDestory(); outerOpportunityAllList = CardManager.Instance.outerOpportunityAllList; foreach (Opportunity r in outerOpportunityAllList) { foreach (int i in CardManager.Instance.opportunityIDList) { if (i == r.id) { currentOpportunityList.Add(r); } } } if (currentOpportunityList.Count == 0) { _objItem.SetActiveEx(false); } else { for (int i = 0; i < currentOpportunityList.Count; i++) { if (i == 0) { var cell = new UIConclusionWindowCell(go); cell.RefreshOuterOpportunity(currentOpportunityList[i]); cell.setBoolInit(); cell.m_bool_Big = 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.RefreshOuterOpportunity(currentOpportunityList[i]); cell.setBoolInit(); cell.m_bool_Big = true; cellObj.Add(tmpObj); } } } }
private void _createOuterOpportunityCell(GameObject go) { cellDestory(); outerOpportunityAllList = CardManager.Instance.outerOpportunityAllList; listNum = outerOpportunityAllList.Count / divisor; if (outerOpportunityAllList.Count % divisor != 0) { updateNum = listNum + 1; remainder = outerOpportunityAllList.Count % divisor; } else { updateNum = listNum; remainder = outerOpportunityAllList.Count % divisor; } for (int i = 0; i < 10; i++) { if (i == 0) { var cell = new UIConclusionWindowCell(go); cell.RefreshOuterOpportunity(outerOpportunityAllList[i]); cell.setBoolInit(); cell.m_bool_Big = 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.RefreshOuterOpportunity(outerOpportunityAllList[i]); cell.setBoolInit(); cell.m_bool_Big = true; cellObj.Add(tmpObj); } } }