| | |
| | | protected Button m_Right; |
| | | protected Button m_Close; |
| | | |
| | | protected Text m_Copper; |
| | | protected Text m_Diamond; |
| | | protected Text m_BindDiamond; |
| | | |
| | | protected RectTransform m_SubWindowContainer; |
| | | public RectTransform subWindowContainer { get { return m_SubWindowContainer; } } |
| | | |
| | |
| | | m_Left = this.GetComponent<Button>("Pivot/Container_Buttons/Btn_Left"); |
| | | m_Right = this.GetComponent<Button>("Pivot/Container_Buttons/Btn_Right"); |
| | | m_Close = this.GetComponent<Button>("Pivot/Container_Buttons/Btn_Close"); |
| | | |
| | | m_Copper = this.GetComponent<Text>("Pivot/Container_BackGround/FollowStoreBottom/SilverCountBG/CountText"); |
| | | if (m_Copper != null) |
| | | m_Diamond = this.GetComponent<Text>("Pivot/Container_BackGround/FollowStoreBottom/GoldCountBG/CountText"); |
| | | m_BindDiamond = this.GetComponent<Text>("Pivot/Container_BackGround/FollowStoreBottom/GoldPaperCountBG/CountText"); |
| | | |
| | | m_SubWindowContainer = this.GetComponent<RectTransform>("Pivot/Container_SubWindow"); |
| | | |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | if (m_Copper == null) |
| | | m_Copper = this.GetComponent<Text>("Pivot/Container_BackGround/FollowStoreBottom/SilverCountBG/CountText"); |
| | | m_Diamond = this.GetComponent<Text>("Pivot/Container_BackGround/FollowStoreBottom/GoldCountBG/CountText"); |
| | | m_BindDiamond = this.GetComponent<Text>("Pivot/Container_BackGround/FollowStoreBottom/GoldPaperCountBG/CountText"); |
| | | |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataUpdate; |
| | | UpdateMoney(); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataUpdate; |
| | | CloseSubWindows(); |
| | | } |
| | | |
| | |
| | | m_Group.SetFunctionListener(order, callBack); |
| | | } |
| | | |
| | | private void OnPlayerDataUpdate(PlayerDataType type) |
| | | { |
| | | switch (type) |
| | | { |
| | | case PlayerDataType.Gold: |
| | | case PlayerDataType.GoldPaper: |
| | | case PlayerDataType.Silver: |
| | | case PlayerDataType.ExAttr6: |
| | | UpdateMoney(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | void UpdateMoney() |
| | | { |
| | | if (m_Copper == null) |
| | | return; |
| | | m_Copper.text = ItemLogicUtility.Instance.OnChangeCoinsUnit(PlayerDatas.Instance.baseData.allCopper); |
| | | m_Diamond.text = PlayerDatas.Instance.baseData.diamond.ToString(); |
| | | m_BindDiamond.text = ItemLogicUtility.Instance.OnChangeCoinsUnit(PlayerDatas.Instance.baseData.bindDiamond); |
| | | } |
| | | } |
| | | |
| | | } |