少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System.Collections;
using System.Collections.Generic;
 
using UnityEngine;
using UnityEngine.UI;
 
namespace vnxbqy.UI
{
    public class TreasureNewGotBehaviour : MonoBehaviour
    {
        [SerializeField] RectTransform m_ContainerFunc;
        [SerializeField] RectTransform m_ContainerSkill;
        [SerializeField] RectTransform m_ContaienrTreasure;
        [SerializeField] Image m_FuncIcon;
        [SerializeField] Image m_SkillIcon;
        [SerializeField] Image m_TreasureIcon;
        [SerializeField] Text m_Func;
        [SerializeField] Text m_FuncName;
 
        [SerializeField] UIAlphaTween alphaTween;
 
        public RectTransform m_SkillContainer
        {
            get { return m_SkillIcon.rectTransform; }
        }
 
        TreasureModel model { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
        public void Display(int id,int stage)
        {
            Treasure treasure;
            alphaTween.SetStartState();
            m_ContainerFunc.SetActive(false);
            m_ContainerSkill.SetActive(false);
            m_ContaienrTreasure.SetActive(false);
            if (model.TryGetTreasure(id, out treasure))
            {
                var treasureStage = treasure.treasureStages.Find((x) =>
                {
                    return x.stage == stage;
                });
                switch (treasureStage.unlockType)
                {
                    case TreasureStageUnlock.Skill:
                        m_ContainerSkill.SetActive(true);
                        var job = PlayerDatas.Instance.baseData.Job;
                        var skillConfig = SkillConfig.Get(treasureStage.GetSkill(job));
                        if (skillConfig != null)
                        {
                            m_SkillIcon.SetSprite(skillConfig.IconName);
                            m_Func.text = Language.Get("TreasureUnlockNewSkill");
                            m_FuncName.text = skillConfig.SkillName;
                        }
                        break;
                    case TreasureStageUnlock.Func:
                        m_ContainerFunc.SetActive(true);
                        var funcConfig = FuncOpenLVConfig.Get(treasureStage.func);
                        if (funcConfig != null)
                        {
                            m_FuncIcon.SetSprite(funcConfig.Icon);
                            m_Func.text = Language.Get("TreasureUnlockNewFunc");
                            m_FuncName.text = funcConfig.Remark;
                        }
                        break;
                }
            }
        }
 
        public void Show()
        {
            gameObject.SetActive(true);
            alphaTween.Play();
        }
    }
}