12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using ET;
- using FairyGUI;
- using UI.Task;
- using UnityEngine;
- namespace GFGGame
- {
- public class TaskView : BaseWindow
- {
- private UI_TaskUI _ui;
- private ValueBarController _valueBarController;
- public override void Dispose()
- {
- if (_valueBarController != null)
- {
- _valueBarController.Dispose();
- _valueBarController = null;
- }
- if (_ui != null)
- {
- _ui.Dispose();
- _ui = null;
- }
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_TaskUI.PACKAGE_NAME;
- _ui = UI_TaskUI.Create();
- this.viewCom = _ui.target;
- isfullScreen = true;
- _valueBarController = new ValueBarController(_ui.m_comValueBar);
- _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gzs_bjbj");
- _ui.m_c1.onChanged.Add(OnCtrlChange);
- }
- protected override void AddEventListener()
- {
- base.AddEventListener();
- }
- protected override void OnShown()
- {
- base.OnShown();
- _valueBarController.OnShown();
- _ui.m_c1.selectedIndex = this.viewData == null ? 1 : (int)(this.viewData as object[])[0];
- }
- protected override void OnHide()
- {
- base.OnHide();
- _valueBarController.OnHide();
- _ui.m_c1.selectedIndex = 0;
- }
- protected override void RemoveEventListener()
- {
- base.RemoveEventListener();
- }
- private void OnCtrlChange()
- {
- if (_ui.m_c1.selectedIndex == 1)
- {
- // ViewManager.Show<DailyTaskView>()
- }
- else if (_ui.m_c1.selectedIndex == 2)
- {
- }
- }
- }
- }
|