58 lines
2.1 KiB
C#
58 lines
2.1 KiB
C#
using CG.UTility;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
/*******************************************************************************
|
|
*Create By CG
|
|
*Function
|
|
*******************************************************************************/
|
|
namespace ZXK.GYJQR
|
|
{
|
|
public class PlayStepAnmBase : Step_0
|
|
{
|
|
public PlayStepAnmBase(AZBS itemAttr) : base(itemAttr) { }
|
|
/// <summary>
|
|
/// 执行路径位移的逻辑
|
|
/// </summary>
|
|
public virtual void OnExcutePathMove()
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// 动画控制方法
|
|
/// </summary>
|
|
/// <param name="AnmCtrlName">动画控制器物体名字</param>
|
|
/// <param name="anmClipName">当前需要播放的动画片段名字</param>
|
|
/// <param name="index">当前动画播放序列</param>
|
|
/// <param name="clipFinishCall">播放完成响应事件</param>
|
|
protected void PlayAnmCtrl(string AnmCtrlName, string anmClipName, int index,Action? startCall ,Action clipFinishCall)
|
|
{
|
|
PathManager pm = outLineParts[0].GetComponent<PathManager>() ? outLineParts[0].GetComponent<PathManager>() : outLineParts[0].AddComponent<PathManager>();
|
|
pm.onMouseDown = new UnityEngine.Events.UnityEvent();
|
|
pm.onMouseDown.AddListener(() =>
|
|
{
|
|
if (StepManager.Instance.CurStep == this)
|
|
{
|
|
if (!CG.UTility.PopUpMng._TriAble) return;
|
|
GameObject AnmCtrlGeo = ModelManager.Instance.SeekAZBSPart(AnmCtrlName);
|
|
|
|
// AnmCtrlGeo.GetComponent<Animator>().SetInteger("StepIndex", index);
|
|
// StartCoroutine(OnDelay(4.5f, clipFinishCall));
|
|
AnimatorEventCtr.Instance.Play(anmClipName, AnmCtrlGeo.GetComponent<Animator>(), index, startCall,
|
|
//结束事件
|
|
() =>
|
|
{
|
|
clipFinishCall();
|
|
}
|
|
);
|
|
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|