void ShowLog() { pvpLogPanel.SetActive(true); textBattleLog.text = BattlePvPManager.userPvPWinCount + "승" + BattlePvPManager.userPvPLossCount + "패"; textBattleLogUserScore.text = BattlePvPManager.userPvPScore + "점"; for (int i = 0; i < battlePvPLogSlotList.Count; i++) { battlePvPLogSlotList[i].gameObject.SetActive(false); } for (int i = 0; i < BattlePvPManager.battleLogList.Count; i++) { BattlePvPLogSlot slot = CreateBattlePvPLogSlot(); slot.InitSlot(BattlePvPManager.battleLogList[i]); slot.gameObject.SetActive(true); } SizeControl(BattlePvPManager.battleLogList.Count); }
BattlePvPLogSlot CreateBattlePvPLogSlot() { BattlePvPLogSlot slot = null; for (int i = 0; i < battlePvPLogSlotList.Count; i++) { if (battlePvPLogSlotList[i].gameObject.activeSelf == false) { slot = battlePvPLogSlotList[i]; break; } } if (slot == null) { GameObject go = Instantiate(battleLogSlotPrefab, battleLogListContent.transform, false); slot = go.GetComponent <BattlePvPLogSlot>(); battlePvPLogSlotList.Add(slot); } return(slot); }