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(); } } protected override void Awake() { otherCoins = proxy.GetWidgtEx("FollowStoreBottom"); gongdeObj = proxy.GetWidgtEx("GongDeBG"); gongdeNum = proxy.GetWidgtEx("gongdeNum"); gushenObj = proxy.GetWidgtEx("gushenmoney"); gushenNum = proxy.GetWidgtEx("gushenCnt"); huanjingObj = proxy.GetWidgtEx("huanjingmoney"); huanjingNum = proxy.GetWidgtEx("huanjingCnt"); //var launchWin = WindowCenter.Instance.Get(); } 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(); } }