少年修仙传客户端代码仓库
hch
2025-03-19 6770e1eb64c4282def45adb824b14b2a407fdd30
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
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
namespace vnxbqy.UI
{
    public class AncientKingBehaviour : MonoBehaviour
    {
        [SerializeField] RectTransform m_ContainerBottom;
        [SerializeField] Text m_AncientKingName;
        [SerializeField] Text m_AncientKingPoint;
        [SerializeField] Button m_Func;
 
        DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
 
        private void Awake()
        {
            m_Func.onClick.AddListener(OnFunc);
        }
 
        public void Init()
        {
            model.updateMissionEvent += Display;
            Display();
        }
 
        public void UnInit()
        {
            model.updateMissionEvent -= Display;
        }
 
        void Display()
        {
            var _help = model.mission;
            m_ContainerBottom.SetActive(!string.IsNullOrEmpty(_help.topName));
            m_AncientKingName.text = _help.topName;
            m_AncientKingPoint.text = UIHelper.ReplaceLargeNum(_help.topScore);
        }
 
        private void OnFunc()
        {
            if (WindowCenter.Instance.IsOpen<DungeonAncientKingWin>())
            {
                WindowCenter.Instance.Close<DungeonAncientKingWin>();
            }
            else
            {
                WindowCenter.Instance.Open<DungeonAncientKingWin>();
            }
        }
    }
}