예제 #1
0
    void Show()
    {
        rankPanel.SetActive(true);

        textLastWeekRank.text = RankManager.lastWeekRank + " 위";

        string text = "";

        if (currentRankType == RankType.DoungenClearStage)
        {
            text = RankManager.lastWeekStage + " stage";
        }
        else if (currentRankType == RankType.Pvp)
        {
            text = RankManager.lastWeekPvPScore + " Score";
        }

        textLastWeekStage.text = text;


        textThisWeekRank.text = RankManager.thisWeekRank + " 위";

        text = "";
        if (currentRankType == RankType.DoungenClearStage)
        {
            text = RankManager.thisWeekStage + " stage";
        }
        else if (currentRankType == RankType.Pvp)
        {
            text = RankManager.thisWeekPvPScore + " Score";
        }

        textThisWeekStage.text = text;

        buttonReward.gameObject.SetActive(!RankManager.isReward);

        for (int i = 0; i < RankManager.rankListDoungenClearStageThisWeek.Count; i++)
        {
            UIRankSlot slot = CreateSlot();
            slot.gameObject.SetActive(true);
            slot.InitSlot(RankManager.rankListDoungenClearStageThisWeek[i]);
        }
        SizeControl(RankManager.rankListDoungenClearStageThisWeek.Count);
    }
예제 #2
0
    UIRankSlot CreateSlot()
    {
        UIRankSlot slot = null;

        for (int i = 0; i < rankSlotPool.Count; i++)
        {
            if (rankSlotPool[i].gameObject.activeSelf == false)
            {
                slot = rankSlotPool[i];
                break;
            }
        }

        if (slot == null)
        {
            GameObject go = Instantiate(rankSlotPrefab);
            go.transform.SetParent(rankScrollViewContent.transform, false);
            slot = go.GetComponent <UIRankSlot>();
            rankSlotPool.Add(slot);
        }

        return(slot);
    }