少年修仙传客户端代码仓库
client_Wu Xijin
2019-06-13 033958214c0b16d7e7b93cc821b018c295251867
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
namespace Snxxz.UI
{
    [XLua.Hotfix]
    public class GatherSoulTipResolve : MonoBehaviour, IGatherSoulTipScrollPart
    {
        [SerializeField] Text m_Title;
        [SerializeField] RectTransform m_ContainerSoulDust;
        [SerializeField] Text m_SoulDust;
        [SerializeField] RectTransform m_ContainerSoulSplinters;
        [SerializeField] Text m_SoulSplinters;
        [SerializeField] RectTransform m_ContainerSoulCore;
        [SerializeField] Text m_SoulCore;
 
        GatheringSoulModel model
        {
            get { return ModelCenter.Instance.GetModel<GatheringSoulModel>(); }
        }
 
        GatherSoulComposeModel composeModel
        {
            get { return ModelCenter.Instance.GetModel<GatherSoulComposeModel>(); }
        }
 
        public void Display(int id, int level)
        {
            GatherSoulComposeModel.Compose compose;
            var requireSoulSplinters = 0;
            var requireSoulCore = 0;
            if (composeModel.TryGetCompose(id, out compose))
            {
                m_Title.text = Language.Get("GatherSoulTipResolve_1");
                requireSoulSplinters = compose.requireSoulSplinters;
                requireSoulCore = compose.requireSoulCore;
            }
            else
            {
                m_Title.text = Language.Get("GatherSoulTipResolve_2");
            }
            m_ContainerSoulDust.gameObject.SetActive(level > 1 || compose == null);
            m_SoulDust.text = StringUtility.Contact("+", model.GetResolveReturnCost(id, level, compose != null));
 
            m_ContainerSoulSplinters.gameObject.SetActive(requireSoulSplinters > 0);
            m_SoulSplinters.text = StringUtility.Contact("+", requireSoulSplinters);
 
            m_ContainerSoulCore.gameObject.SetActive(requireSoulCore > 0);
            m_SoulCore.text = StringUtility.Contact("+", requireSoulCore);
        }
 
        public float GetHeight()
        {
            return (this.transform as RectTransform).sizeDelta.y;
        }
    }
}