using System; using vnxbqy.UI; using UnityEngine; using UnityEngine.UI; public class StoreWinFix : ILBehaviour { Transform otherCoins; Transform gongdeObj; Text gongdeNum; Transform gushenObj; Text gushenNum; 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"); //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; default: break; } } void RefreshCoins() { gongdeNum.text = ItemLogicUtility.Instance.OnChangeCoinsUnit(HeroControler.Instance.GetMoneyCntIL(35)); gushenNum.text = ItemLogicUtility.Instance.OnChangeCoinsUnit(HeroControler.Instance.GetMoneyCntIL(34)); } void OnStoreRefreshUI() { otherCoins.SetActiveIL(model.storeFuncType == StoreFunc.IntegralStore || model.storeFuncType == StoreFunc.DayStore); gongdeObj.SetActiveIL(model.storeFuncType == StoreFunc.MysteryStore); gushenObj.SetActiveIL(model.storeFuncType == StoreFunc.GrowStrongerStore); RefreshCoins(); } }