少年修仙传客户端代码仓库
hch
4 天以前 600733c8f592cb9e65f2b7a3e110ac1d686e6bfe
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
using System;
using vnxbqy.UI;
using UnityEngine;
using UnityEngine.UI;
 
public class StoreWinFix : ILBehaviour
{
    Transform otherCoins;
    Transform gongdeObj;
    Text gongdeNum;
    Transform gushenObj;
    Text gushenNum;
    Transform huanjingObj;
    Text huanjingNum;
 
    StoreModel model { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
    protected override void Awake()
    {
        otherCoins = proxy.GetWidgtEx<Transform>("FollowStoreBottom");
        gongdeObj = proxy.GetWidgtEx<Transform>("GongDeBG");
        gongdeNum = proxy.GetWidgtEx<Text>("gongdeNum");
        gushenObj = proxy.GetWidgtEx<Transform>("gushenmoney");
        gushenNum = proxy.GetWidgtEx<Text>("gushenCnt");
        huanjingObj = proxy.GetWidgtEx<Transform>("huanjingmoney");
        huanjingNum = proxy.GetWidgtEx<Text>("huanjingCnt");
        //var launchWin = WindowCenter.Instance.Get<LaunchWin>();
    }
    protected override void OnEnable()
    {
        PlayerDatas.Instance.playerDataRefreshEvent += OnRefreshPlayerInfo;
        UIFixModel.Instance.OnStoreRefreshUIEvent += OnStoreRefreshUI;
    }
 
 
    protected override void OnDisable()
    {
        PlayerDatas.Instance.playerDataRefreshEvent -= OnRefreshPlayerInfo;
        UIFixModel.Instance.OnStoreRefreshUIEvent -= OnStoreRefreshUI;
    }
    
 
    private void OnRefreshPlayerInfo(PlayerDataType refreshType)
    {
        switch (refreshType)
        {
            case PlayerDataType.default14:
                RefreshCoins();
                break;
            case PlayerDataType.default43:
                RefreshCoins();
                break;
            default:
                break;
        }
    }
 
    void RefreshCoins()
    {
        gongdeNum.text = ItemLogicUtility.Instance.OnChangeCoinsUnit(HeroControler.Instance.GetMoneyCntIL(35));
        gushenNum.text = ItemLogicUtility.Instance.OnChangeCoinsUnit(HeroControler.Instance.GetMoneyCntIL(34));
        huanjingNum.text = ItemLogicUtility.Instance.OnChangeCoinsUnit(UIHelper.GetMoneyCnt(50));
    }
 
    void OnStoreRefreshUI()
    {
        otherCoins.SetActiveIL(model.storeFuncType == StoreFunc.IntegralStore || model.storeFuncType == StoreFunc.DayStore);
        gongdeObj.SetActiveIL(model.storeFuncType == StoreFunc.MysteryStore);
        gushenObj.SetActiveIL(model.storeFuncType == StoreFunc.GrowStrongerStore);
        huanjingObj.SetActiveIL(model.storeFuncType == StoreFunc.CommonStore);
        RefreshCoins();
    }
}