少年修仙传客户端代码仓库
hch
2025-07-24 50e53441950268933694eeb5aad36147bbe1014d
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
using UnityEngine;
 
namespace vnxbqy.UI
{
    //福地-管理
    public class BlessedLandManageMouseRenewalPopWin : Window
    {
        [SerializeField] ButtonEx btnClose;
        [SerializeField] TextEx txtHireTime;
        [SerializeField] BlessedLandManageMouseButton btnBuy1;
        [SerializeField] BlessedLandManageMouseButton btnBuy2;
 
        BlessedLandModel blessedLandModel { get { return ModelCenter.Instance.GetModel<BlessedLandModel>(); } }
 
        protected override void BindController()
        {
        }
 
        protected override void AddListeners()
        {
            btnClose.SetListener(CloseClick);
        }
 
        protected override void OnPreOpen()
        {
            GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
            Display();
            DisplayTime();
        }
 
        protected override void OnAfterOpen()
        {
        }
 
        protected override void OnAfterClose()
        {
        }
 
        protected override void OnPreClose()
        {
            GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
        }
 
        private void OnSecondEvent()
        {
            DisplayTime();
        }
 
        public void Display()
        {
            //type 1折的表现用图片还是下划线 1下划线 2 图片
            //index 管家档位购买对应充值ID列表中的1维索引
            btnBuy1.Display(2, 0);
            btnBuy2.Display(2, 1);
        }
 
        public void DisplayTime()
        {
            string hireTime = TimeUtility.SecondsToDHMS((int)blessedLandModel.HousekeeperEndTime - TimeUtility.AllSeconds);
            string hireTimeText = Language.Get("BlessedLand068", UIHelper.AppendColor(TextColType.Green, hireTime, true));
            txtHireTime.text = hireTimeText;
        }
    }
}