123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using FairyGUI;
- using UnityEngine;
- using UI.Main;
- namespace GFGGame
- {
- public class StoryFightSingleView : BaseView
- {
- private UI_StoryFightSingleUI _ui;
- private GameObject _sceneObject;
- private GameObject _scenePrefab;
- public override void Dispose()
- {
- if(_scenePrefab != null)
- {
- GameObject.Destroy(_scenePrefab);
- _scenePrefab = null;
- }
- base.Dispose();
- }
- protected override void Init()
- {
- base.Init();
- _ui = UI_StoryFightSingleUI.Create();
- viewCom = _ui.target;
- isfullScreen = true;
- _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneFightSingle"));
- }
- protected override void OnInit()
- {
- base.OnInit();
- }
- protected override void OnShown()
- {
- base.OnShown();
- if(_sceneObject == null)
- {
- _sceneObject = GameObject.Instantiate(_scenePrefab);
- }
- SceneController.UpdateRole(EquipDataCache.cacher.equipDatas, _sceneObject);
- _ui.m_roleName.m_txtName.text = RoleDataManager.roleName;
- Timers.inst.Add(0.9f, 1, (object param) => {
- this.Hide();
- ViewManager.Show(ViewName.STORY_FIGHT_SINGLE_SCORE_VIEW);
- });
- }
- protected override void OnHide()
- {
- base.OnHide();
- if(_sceneObject != null)
- {
- GameObject.Destroy(_sceneObject);
- _sceneObject = null;
- }
- }
- }
- }
|