Beispiel #1
0
    /// <summary>
    /// 设置成就达成条件
    /// </summary>
    /// <param name="data"></param>
    public void SetAchieve(AchievementStatusEnum status, AchievementInfoBean data)
    {
        CptUtil.RemoveChildsByActive(objAchieveContent.transform);
        if (data == null)
        {
            return;
        }
        List <PreTypeBean> listPreData = PreTypeEnumTools.GetListPreData(data.pre_data);
        GameDataBean       gameData    = GameDataHandler.Instance.manager.GetGameData();

        foreach (var itemPreData in listPreData)
        {
            if (status == AchievementStatusEnum.Completed)
            {
                PreTypeEnumTools.GetPreDetails(itemPreData, gameData, true);
            }
            else
            {
                PreTypeEnumTools.GetPreDetails(itemPreData, gameData, false);
            }
            string preDes   = itemPreData.preDescribe;
            float  progress = itemPreData.progress;
            CreateAchieveItem(preDes, progress);
        }
    }
Beispiel #2
0
    /// <summary>
    /// 设置状态
    /// </summary>
    /// <param name="status"></param>
    public void SetStatus(AchievementStatusEnum status)
    {
        if (tvStatus != null)
        {
            switch (status)
            {
            case AchievementStatusEnum.Completed:
                tvStatus.text  = TextHandler.Instance.manager.GetTextById(12001);
                tvStatus.color = colorStatusCompleted;
                break;

            case AchievementStatusEnum.Processing:
                tvStatus.text  = TextHandler.Instance.manager.GetTextById(12002);
                tvStatus.color = new Color();
                tvStatus.color = colorStatusProcessing;
                break;

            case AchievementStatusEnum.ToBeConfirmed:
                tvStatus.text  = TextHandler.Instance.manager.GetTextById(12003);
                tvStatus.color = new Color();
                tvStatus.color = new Color(1, 0.2f, 0, 1);
                break;
            }
        }
    }
Beispiel #3
0
 public void SetData(AchievementStatusEnum status, AchievementInfoBean achievementInfo)
 {
     this.status          = status;
     this.achievementInfo = achievementInfo;
     SetIcon(achievementInfo.GetAchievementType(), achievementInfo.icon_key, achievementInfo.icon_key_remark);
     SetName(achievementInfo.name);
     SetContent(achievementInfo.content);
     SetAchieve(status, achievementInfo);
     SetStatus(status);
     SetReward(achievementInfo);
 }
Beispiel #4
0
    public void SetAchStatus(AchievementStatusEnum status)
    {
        this.status = status;
        if (achievementInfo == null || ivIcon == null || ivBackground == null)
        {
            return;
        }
        switch (status)
        {
        case AchievementStatusEnum.UnKnown:
            //未知
            ivIcon.sprite       = spIconUnknow;
            ivBackground.sprite = spBackLock;
            break;

        case AchievementStatusEnum.Completed:
            //已解锁
            SetIcon(achievementInfo.GetAchievementType(), achievementInfo.icon_key, achievementInfo.icon_key_remark, null);
            ivBackground.sprite = spBackUnLock;
            break;

        case AchievementStatusEnum.Processing:
            //未解锁 不满足条件
            SetIcon(achievementInfo.GetAchievementType(), achievementInfo.icon_key, achievementInfo.icon_key_remark, materialGray);
            ivBackground.sprite = spBackLock;
            break;

        case AchievementStatusEnum.ToBeConfirmed:
            //未解锁 满足条件
            SetIcon(achievementInfo.GetAchievementType(), achievementInfo.icon_key, achievementInfo.icon_key_remark, materialGray);
            ivBackground.sprite = spBackPass;
            break;
        }
        //弹出框刷新数据
        if (popupButton != null)
        {
            popupButton.SetData(status, achievementInfo);
        }
    }
Beispiel #5
0
 public void SetData(AchievementStatusEnum status, AchievementInfoBean achievementInfo)
 {
     this.achievementInfo = achievementInfo;
     this.status          = status;
 }