112 lines
3.0 KiB
C#
112 lines
3.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
using FairyGUI;
|
|
using BingoBrain.Core;
|
|
|
|
using BingoBrain;
|
|
using FGUI.G003_play_animal;
|
|
using DG.Tweening;
|
|
using Spine.Unity;
|
|
using System;
|
|
|
|
namespace BingoBrain
|
|
{
|
|
public class OpenGameUI : BaseUI
|
|
{
|
|
private OpenGameUICtrl ctrl;
|
|
private OpenGameModel model;
|
|
private FGUI.G003_play_animal.com_opengame ui;
|
|
|
|
public OpenGameUI(OpenGameUICtrl ctrl) : base(ctrl)
|
|
{
|
|
uiName = UIConst.OpenGameUI;
|
|
this.ctrl = ctrl;
|
|
}
|
|
|
|
protected override void SetUIInfo(UIInfo uiInfo)
|
|
{
|
|
uiInfo.packageName = "G003_play_animal";
|
|
uiInfo.assetName = "com_opengame";
|
|
uiInfo.layerType = UILayerType.Popup;
|
|
uiInfo.isNeedOpenAnim = false;
|
|
uiInfo.isNeedCloseAnim = false;
|
|
uiInfo.isNeedUIMask = false;
|
|
}
|
|
|
|
#region 生命周期
|
|
protected override void OnInit()
|
|
{
|
|
//model = ModuleManager.Instance.GetModel(ModelConst.OpenGameModel) as OpenGameModel;
|
|
}
|
|
|
|
protected override void OnClose()
|
|
{
|
|
|
|
}
|
|
|
|
protected override void OnBind()
|
|
{
|
|
ui = baseUI as FGUI.G003_play_animal.com_opengame;
|
|
}
|
|
|
|
protected override void OnOpenBefore(object args)
|
|
{
|
|
DOVirtual.DelayedCall(0.7f, () => { GameDispatcher.Instance.Dispatch(GameMsg.reset_game, args); });
|
|
InitView();
|
|
}
|
|
|
|
protected override void OnOpen(object args)
|
|
{
|
|
}
|
|
|
|
protected override void OnHide()
|
|
{
|
|
}
|
|
|
|
protected override void OnDisplay(object args)
|
|
{
|
|
}
|
|
#endregion
|
|
|
|
#region 消息
|
|
protected override void AddListener()
|
|
{
|
|
|
|
}
|
|
protected override void RemoveListener()
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
|
|
private Action closeCallback;
|
|
//初始化页面逻辑
|
|
private void InitView()
|
|
{
|
|
ui.lv_text.text = "Level " + GameHelper.GetLevel().ToString();
|
|
ui.t1.Play(() =>
|
|
{
|
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Close);
|
|
});
|
|
if (GameHelper.IsShowLevelTips())
|
|
{
|
|
Debug.Log("????????????");
|
|
ui.tips_node.visible = true;
|
|
FX.Instance.SetFx<SkeletonAnimation>(ui.tips_node, Fx_Type.fx_tips, sk =>
|
|
{
|
|
// NAAVsa.AddCompleteEvent(cardSpine, OnChangeCardFinish);
|
|
// OnChangeCardFinish(null);
|
|
NAAVsa.PlayAnim(sk, "animation", false);
|
|
}, closeCallback);
|
|
|
|
// DOVirtual.DelayedCall(0.2f, () =>
|
|
// {
|
|
// ui.tips_node.visible = true;
|
|
// var meteor1 = FXManager.Instance.SetFx<SkeletonAnimation>(ui.tips_node, Fx_Type.fx_tips, ref closeCallback);
|
|
// });
|
|
}
|
|
}
|
|
}
|
|
} |