123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using UnityEngine;
- using FairyGUI;
- using UI.CommonGame;
- using System.Collections.Generic;
- namespace GFGGame
- {
- public class FunctionOpenView : BaseWindow
- {
- private UI_FunctionOpenUI _ui;
- List<string> _funList = new List<string>();
- private GameObject _effectObj;
- private GoWrapper _wrapper;
- public override void Dispose()
- {
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_FunctionOpenUI.PACKAGE_NAME;
- _ui = UI_FunctionOpenUI.Create();
- this.viewCom = _ui.target;
- isfullScreen = true;
- this.viewCom.Center();
- this.modal = true;
- this.clickBlankToClose = false;
- }
- protected override void OnShown()
- {
- base.OnShown();
- List<string> funList = (viewData as object) as List<string>;
- AddFunDatas(funList);
- UpdateFunIcon();
- }
- private void AddFunDatas(List<string> itemList)
- {
- for (int i = 0; i < itemList.Count; i++)
- {
- if (_funList.IndexOf(itemList[i]) < 0)
- {
- _funList.Add(itemList[i]);
- }
- }
- }
- private void UpdateFunIcon()
- {
- if (_funList.Count == 0)
- {
- this.Hide();
- return;
- }
- string resPath = ResPathUtil.GetViewEffectPath("ui_xjs", "ui_xjs");
- SceneController.AddObjectToView(_effectObj, _wrapper, _ui.m_holder, resPath, out _effectObj, out _wrapper);
- FunctionOpenCfg cfg = FunctionOpenCfgArray.Instance.GetCfg(_funList[0]);
- _ui.m_ComFunctionOpen.m_txtName.text = cfg.name;
- _ui.m_ComFunctionOpen.m_logIcon.url = ResPathUtil.GetCommonGameResPath(cfg.res);
- _funList.RemoveAt(0);
- _ui.m_t0.Play(UpdateFunIcon);
- }
- protected override void OnHide()
- {
- base.OnHide();
- }
- }
- }
|