83 lines
2.2 KiB
C#
83 lines
2.2 KiB
C#
|
|
using DG.Tweening;
|
||
|
|
using System;
|
||
|
|
using FairyGUI;
|
||
|
|
using Spine.Unity;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace FlowerPower
|
||
|
|
{
|
||
|
|
|
||
|
|
public class GuideViewUI : BaseUI
|
||
|
|
{
|
||
|
|
private GuideViewUICtrl ctrl;
|
||
|
|
private GuideViewModel model;
|
||
|
|
private FGUI.P22_Guide.com_guide ui;
|
||
|
|
|
||
|
|
protected GProgressBar pb_loading;
|
||
|
|
private Tweener tweener;
|
||
|
|
|
||
|
|
|
||
|
|
protected int currValue;
|
||
|
|
|
||
|
|
public GuideViewUI(GuideViewUICtrl ctrl) : base(ctrl)
|
||
|
|
{
|
||
|
|
uiName = UIConst.GuideViewUI;
|
||
|
|
this.ctrl = ctrl;
|
||
|
|
}
|
||
|
|
|
||
|
|
protected override void SetUIInfo(UIInfo uiInfo)
|
||
|
|
{
|
||
|
|
uiInfo.packageName = "P22_Guide";
|
||
|
|
uiInfo.assetName = "com_guide";
|
||
|
|
uiInfo.layerType = UILayerType.Loading;
|
||
|
|
uiInfo.isNeedOpenAnim = false;
|
||
|
|
uiInfo.isNeedCloseAnim = false;
|
||
|
|
uiInfo.isNeedUIMask = false;
|
||
|
|
}
|
||
|
|
|
||
|
|
#region 生命周期
|
||
|
|
|
||
|
|
protected override void OnInit()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
protected override void OnClose()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
protected override void OnBind()
|
||
|
|
{
|
||
|
|
ui = baseUI as FGUI.P22_Guide.com_guide;
|
||
|
|
}
|
||
|
|
private Action closeCallback;
|
||
|
|
|
||
|
|
protected override void OnOpenBefore(object args)
|
||
|
|
{
|
||
|
|
TimerHelper.mEasy.AddTimer(0.7f, () =>
|
||
|
|
{
|
||
|
|
ui.btn_new_start.visible = true;
|
||
|
|
var ska = FXManager.Instance.SetFx<SkeletonAnimation>(ui.btn_new_start.GetChild("btn_parent") as GGraph, Fx_Type.fx_btn_start, ref closeCallback);
|
||
|
|
ska.state.SetAnimation(0, "play", true);
|
||
|
|
var finger = FXManager.Instance.SetFx<SkeletonAnimation>(ui.finger_parent, Fx_Type.fx_hand_pre, ref closeCallback);
|
||
|
|
finger.state.SetAnimation(0, "idle", true);
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
ui.btn_new_start.SetClick(()=>{
|
||
|
|
PlayerPrefs.SetInt("new_one", 1);
|
||
|
|
|
||
|
|
GameHelper.gameType = 0;
|
||
|
|
GameDispatcher.Instance.Dispatch(GameMsg.OpenGame);
|
||
|
|
CtrlCloseUI();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
protected override void OnOpen(object args)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
#endregion
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|