using FairyGUI; using UnityEngine; using UI.Main; using System.Collections; using System.Collections.Generic; using ET; namespace GFGGame { public class ArenaFightResultView : BaseView { private UI_ArenaFightResultUI _ui; private GameObject _scenePrefab; private GameObject _sceneObject; public override void Dispose() { if (_ui != null) { _ui.Dispose(); } _ui = null; base.Dispose(); } protected override void Init() { base.Init(); _ui = UI_ArenaFightResultUI.Create(); viewCom = _ui.target; isfullScreen = true; } protected override void OnInit() { base.OnInit(); _ui.m_btnClose.onClick.Add(OnClickBtnClose); // _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("fightBg"); _scenePrefab = GFGAsset.Load(ResPathUtil.GetPrefabPath("SceneFightResult")); } protected override void OnShown() { base.OnShown(); FightData roleData = ArenaDataManager.Instance.DressupList[ArenaDataManager.Instance.CurFightIndex]; if (_sceneObject == null) { _sceneObject = GameObject.Instantiate(_scenePrefab); MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject, false, false, null, false); } MyDressUpHelper.dressUpObj.PutOnItemList(roleData.itemList); long myScore = ArenaDataManager.Instance.myScore[ArenaDataManager.Instance.CurFightIndex]; long targetScore = ArenaDataManager.Instance.targetScore[ArenaDataManager.Instance.CurFightIndex]; _ui.m_comResult.m_c1.selectedIndex = myScore > targetScore ? 3 : 0; _ui.m_comResult.m_txtScore.text = myScore.ToString(); // _ui.m_comResult.m_grpStar.visible = false; _ui.m_btnClose.enabled = false; ShowResultView(); } private void ShowResultView() { ArenaDataManager.Instance.CurFightIndex++; _ui.m_comResult.m_t0.Play(() => { ViewManager.Show(); _ui.m_btnClose.enabled = true; }); } protected override void OnHide() { base.OnHide(); if (_sceneObject != null) { GameObject.Destroy(_sceneObject); _sceneObject = null; } MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT)); _ui.m_comResult.target.height = 0; _ui.m_comResult.m_t1.Play(); _ui.m_comResult.m_t0.Stop(true, false); // _ui.m_t0.Stop(true, false); // _ui.m_comRoleResult.m_t3.Stop(true, false); // _ui.m_comRoleResult.m_t0.Stop(true, false); if (ArenaDataManager.Instance.CurFightIndex > 2) { object[] goBackDatas = ViewManager.GetGoBackDatas(typeof(ArenaView).FullName); ViewManager.Show(null, goBackDatas, true); } } private void OnClickBtnClose(object param) { this.Hide(); } } }