| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using UnityEngine; |
| | | |
| | | public class FirstChargeWin : FunctionsBaseWin |
| | | { |
| | | [SerializeField] ButtonEx btnClose; |
| | | [Header("标签页")] |
| | | [SerializeField] TextEx[] txtTabTitles; |
| | | [SerializeField] ButtonEx[] btnTabs; |
| | | [SerializeField] RedpointBehaviour[] rpTabs; |
| | | [SerializeField] int fontSizeBefore = 24; |
| | | [SerializeField] int fontSizeAfter = 30; |
| | | [Header("主物品")] |
| | | [SerializeField] TextEx txtName; |
| | | [SerializeField] TextEx txtDesc; |
| | |
| | | |
| | | [Header("购买和领取")] |
| | | [SerializeField] ImageEx imgHave; |
| | | [SerializeField] ImageEx imgNoHave; |
| | | [SerializeField] ImageEx imgRed; |
| | | [SerializeField] TextEx txtHave; |
| | | [SerializeField] ButtonEx btnHave; |
| | |
| | | btnHave.SetListener(OnClickHaveButton); |
| | | btnBuy.SetListener(OnClickBuyButton); |
| | | btnPreviewHero.SetListener(OnClickPreviewHero); |
| | | btnClose.SetListener(() => UIManager.Instance.CloseWindow<FirstChargeWin>()); |
| | | } |
| | | |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | functionOrder = GetDefaultTabIndex(); |
| | | base.OnPreOpen(); |
| | | InitRedPoint(); |
| | | |
| | | functionOrder = GetDefaultTabIndex(); |
| | | tabButtons[functionOrder].SelectBtn(true); |
| | | |
| | | int firstId = model.GetFirstIDByTabIndex(functionOrder); |
| | | model.SetClickTabState(firstId); |
| | |
| | | { |
| | | for (int i = 0; i < btnTabs.Length; i++) |
| | | { |
| | | txtTabTitles[i].fontSize = i == functionOrder ? fontSizeAfter : fontSizeBefore; |
| | | |
| | | int firstID = model.GetFirstIDByTabIndex(i); |
| | | FirstChargeData firstChargeData; |
| | | if (!model.TryGetFirstChargeDataByFirstId(firstID, out firstChargeData)) |
| | |
| | | int awardState = firstChargeData.GetHaveState(day); |
| | | bool isAllHave = firstChargeData.IsAllHave(); |
| | | btnHave.interactable = awardState == 2; |
| | | imgNoHave.SetActive(awardState != 2); |
| | | imgHave.SetActive(awardState == 2); |
| | | imgHave.gray = awardState != 2; |
| | | imgRed.SetActive(awardState == 2); |
| | | if (awardState == 2) |
| | | { |