ArenaLoadingView.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using FairyGUI;
  2. using UI.Arena;
  3. using UnityEngine;
  4. using System;
  5. using System.Collections.Generic;
  6. using cfg.GfgCfg;
  7. namespace GFGGame
  8. {
  9. public class ArenaLoadingView : BaseWindow
  10. {
  11. private UI_ArenaLoadingUI _ui;
  12. private EffectUI _effectUI1;
  13. public override void Dispose()
  14. {
  15. EffectUIPool.Recycle(_effectUI1);
  16. _effectUI1 = null;
  17. if (_ui != null)
  18. {
  19. _ui.Dispose();
  20. _ui = null;
  21. }
  22. base.Dispose();
  23. }
  24. protected override void OnInit()
  25. {
  26. base.OnInit();
  27. packageName = UI_ArenaLoadingUI.PACKAGE_NAME;
  28. _ui = UI_ArenaLoadingUI.Create();
  29. this.viewCom = _ui.target;
  30. isfullScreen = true;
  31. //isReturnView = true;
  32. EffectUIPool.CreateEffectUI(_ui.m_holder, "ui_dljm", "ui_dljm_jdt_tw",
  33. onComplete: (effect) =>
  34. {
  35. if (effect != null)
  36. {
  37. _effectUI1 = effect;
  38. }
  39. });
  40. }
  41. protected override void AddEventListener()
  42. {
  43. base.AddEventListener();
  44. }
  45. protected override void OnShown()
  46. {
  47. base.OnShown();
  48. string res = CommonDataManager.Tables.TblArenaOpenCfg.GetOrDefault(ArenaDataManager.Instance.SeasonId).Res;
  49. _ui.m_loaBg.url = ResPathUtil.GetBgImgPath(res);
  50. _ui.m_progressBar1.TweenValue(100, 1).OnComplete(Hide);
  51. List<TipsDescCfg> tipsArray = CommonDataManager.Tables.TblTipsDescCfg.DataList;
  52. System.Random rand = new System.Random();
  53. _ui.m_txtDescLeft.text = tipsArray[rand.Next(0, tipsArray.Count)].Text;
  54. }
  55. protected override void OnHide()
  56. {
  57. base.OnHide();
  58. _ui.m_progressBar1.value = 0;
  59. }
  60. protected override void RemoveEventListener()
  61. {
  62. base.RemoveEventListener();
  63. }
  64. }
  65. }