123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- using System;
- using System.Collections.Generic;
- using ET;
- using FairyGUI;
- using UI.DailyWelfare;
- using UnityEngine;
- namespace GFGGame
- {
- public class DailyWelfareView : BaseWindow
- {
- private UI_DailyWelfareUI _ui;
- private ValueBarController _valueBarController;
- private int _month;
- private int _day;
- public override void Dispose()
- {
- base.Dispose();
- if (_valueBarController != null)
- {
- _valueBarController.Dispose();
- _valueBarController = null;
- }
- if (_ui != null)
- {
- _ui.Dispose();
- _ui = null;
- }
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_DailyWelfareUI.PACKAGE_NAME;
- _ui = UI_DailyWelfareUI.Create();
- this.viewCom = _ui.target;
- isfullScreen = true;
- _valueBarController = new ValueBarController(_ui.m_comValueBar);
- _ui.m_btnback.onClick.Add(OnBtnBackClick);
- _ui.m_list.itemRenderer = ListItemRender;
- }
- protected override void OnShown()
- {
- base.OnShown();
- _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("mrqd_bjbj");
- _valueBarController.OnShown();
- _month = DateTime.Now.Month;
- _day = DateTime.Now.Day;
- UpdateList();
- UpdateReward();
- _ui.m_list.ScrollToView(0);
- }
- protected override void OnHide()
- {
- _valueBarController.OnHide();
- base.OnHide();
- }
- private void OnBtnBackClick()
- {
- ViewManager.GoBackFrom(typeof(DailyWelfareView).FullName);
- }
- private void UpdateSgignView()
- {
- _ui.m_txtSignCount.text = DailyWelfareManager.Instance.DailySignDatas.Count.ToString();
- _ui.m_proSign.target.max = DailySignCfgArray.Instance.GetCfgsBymonth(_month).Count;
- _ui.m_proSign.target.value = DailyWelfareManager.Instance.DailySignDatas.Count;
- List<DailySignCfg> signCfgs = DailySignCfgArray.Instance.GetCfgsBymonth(_month);
- for (int i = 0; i < signCfgs.Count; i++)
- {
- GComponent comProBonus = _ui.m_proSign.target.GetChild("comProBonus" + i).asCom;
- comProBonus.x = (signCfgs[i].day / (float)_ui.m_proSign.target.max) * _ui.m_proSign.target.width;
- UI_ComProBonus item = UI_ComProBonus.Proxy(comProBonus);
- item.m_loaIcon.url = ResPathUtil.GetIconPath(ItemCfgArray.Instance.GetCfg(signCfgs[i].bonusArr[0][0]));
- // item
- UI_ComProBonus.ProxyEnd();
- }
- }
- private void UpdateSupplyView()
- {
- }
- private void UpdateList()
- {
- }
- private void UpdateReward()
- {
- }
- private void ListItemRender(int index, GObject obj)
- {
- }
- private void ListBonusItemRender(int index, GObject obj)
- {
- }
- }
- }
|