Esempio n. 1
0
    public void Hide()
    {
        if (m_Ready == false)
        {
            return;
        }
        m_Ready = false;

        SoundUtil.PlaySE(SEID.SE_MENU_RET);

        if (AndroidBackKeyManager.HasInstance)
        {
            //バックキーが押された時のアクションを解除
            AndroidBackKeyManager.Instance.StackPop(gameObject);
        }

        if (hideAction != null)
        {
            hideAction(scoreInfo);
        }

        gameObject.transform.DOScaleY(WindowHideScale, AnimationTime).OnComplete(() =>
        {
            RewardList.Clear();
            UnityUtil.SetObjectEnabledOnce(gameObject, false);
            m_Show = false;
        });
    }
Esempio n. 2
0
    private void updateRewardList()
    {
        if (scoreInfo == null)
        {
            return;
        }

        RewardList.Clear();
        achieveList.Clear();

        List <PacketStructUserScoreReward> viewList = new List <PacketStructUserScoreReward>();
        List <PacketStructUserScoreReward> getList  = new List <PacketStructUserScoreReward>();

        if (scoreInfo.reward_list != null)
        {
            for (int i = 0; i < scoreInfo.reward_list.Length; i++)
            {
                if (scoreInfo.reward_list[i] == null)
                {
                    continue;
                }
                if (scoreInfo.reward_list[i].type - 1 != TabIndex)
                {
                    continue;
                }

                bool bAchieve = false;
                switch (scoreInfo.reward_list[i].type)
                {
                case 1:
                {
                    if (scoreInfo.hi_score >= scoreInfo.reward_list[i].score)
                    {
                        bAchieve = true;
                    }
                }
                break;

                case 2:
                {
                    if (scoreInfo.total_score >= scoreInfo.reward_list[i].score)
                    {
                        bAchieve = true;
                    }
                }
                break;
                }

                if (bAchieve)
                {
                    achieveList.Add(scoreInfo.reward_list[i]);
                }
                else
                {
                    viewList.Add(scoreInfo.reward_list[i]);
                }
            }
        }
        if (scoreInfo.get_list != null)
        {
            for (int i = 0; i < scoreInfo.get_list.Length; i++)
            {
                if (scoreInfo.get_list[i] == null)
                {
                    continue;
                }
                if (scoreInfo.get_list[i].type - 1 != TabIndex)
                {
                    continue;
                }
                getList.Add(scoreInfo.get_list[i]);
            }
        }

        IsActiveGetAll = false;

        if (achieveList.Count != 0)
        {
            achieveList.Sort((a, b) => a.score - b.score);
            for (int i = 0; i < achieveList.Count; i++)
            {
                ScoreRewardContext scoreReward = new ScoreRewardContext();
                scoreReward.setData(achieveList[i], ScoreRewardContext.REWARD_ACHIIEVE);
                RewardList.Add(scoreReward);
            }

            IsActiveGetAll = true;
        }
        if (viewList.Count != 0)
        {
            viewList.Sort((a, b) => a.score - b.score);
            for (int i = 0; i < viewList.Count; i++)
            {
                ScoreRewardContext scoreReward = new ScoreRewardContext();
                scoreReward.setData(viewList[i], ScoreRewardContext.REWARD_SHOW);
                RewardList.Add(scoreReward);
            }
        }
        if (getList.Count != 0)
        {
            getList.Sort((a, b) => a.score - b.score);
            for (int i = 0; i < getList.Count; i++)
            {
                ScoreRewardContext scoreReward = new ScoreRewardContext();
                scoreReward.setData(getList[i], ScoreRewardContext.REWARD_GET);
                RewardList.Add(scoreReward);
            }
        }
        scrollContent.Initialize(this);
    }