少年修仙传客户端代码仓库
lcy
2024-12-16 a39c35fc6449430cd02bccb681c4a0a880e46cd9
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.Generic;
using UnityEngine;
using UnityEngine.UI;
 
using System.Linq;
 
namespace vnxbqy.UI
{
    
    public class FashionAttrBeh : MonoBehaviour
    {
        [SerializeField] Text titleText;
        [SerializeField] Text starDesText;
        [SerializeField] List<Text> attrlist = new List<Text>();
 
        
        FashionDressModel fashionModel { get { return ModelCenter.Instance.GetModel<FashionDressModel>(); } }
 
        public void SetDisplay(int star,int curStar)
        {
            int curFashionId = fashionModel.viewFashionDressId;
            FashionDress fashionDress = null;
            fashionModel.TryGetFashionDress(curFashionId,out fashionDress);
            int minStar = 1;
            int maxStar = fashionDress.maxLevel;
 
            if(star == curStar
                && curStar < maxStar)
            {
                titleText.text = Language.Get("FashionDress101",maxStar);
            }
            else if(star == curStar
                && curStar >= maxStar)
            {
                titleText.text = Language.Get("FashionDress105");
            }
            else
            {
                titleText.text = Language.Get("FashionDress102",star);
            }
 
            if (star == curStar)
            {
                starDesText.text = Language.Get("FashionDress103",star);
            }
            else
            {
                starDesText.text = Language.Get("FashionDress104",star);
            }
 
            Dictionary<int, int> attrDict = null;
            fashionModel.TryGetFashionDressProperty(curFashionId,star,out attrDict);
            if(attrDict != null)
            {
                List<int> attrIds = attrDict.Keys.ToList();
                for (int i = 0; i < attrlist.Count; i++)
                {
                    var attrText = attrlist[i];
                    if (i < attrIds.Count)
                    {
                        attrText.SetActive(true);
                        int attrId = attrIds[i];
                        int attrValue = attrDict[attrId];
                        attrText.text = PlayerPropertyConfig.GetFullDescription(attrId,attrValue); 
                    }
                    else
                    {
                        attrText.SetActive(false);
                    }
                }
            }
        }
          
    }
}