2026-03-20 12:07:44 -04:00
|
|
|
|
using Opsive.BehaviorDesigner.Runtime.Tasks;
|
|
|
|
|
|
using Opsive.GraphDesigner.Runtime;
|
|
|
|
|
|
using Opsive.Shared.Utility;
|
|
|
|
|
|
using SLSUtilities.FunctionalAnimation;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Cielonos.MainGame.Characters.AI
|
|
|
|
|
|
{
|
|
|
|
|
|
[Description("让角色播放一个功能动画,播放过程中会检测打断情况。")]
|
|
|
|
|
|
[NodeIcon("Assets/Sprites/Icon/Play.png")]
|
|
|
|
|
|
[Category("Cielonos")]
|
|
|
|
|
|
public class IsPlayingFuncAnim : AutomataConditionalBase
|
|
|
|
|
|
{
|
|
|
|
|
|
private AnimationSubcontrollerBase animationSc => self.animationSc;
|
2026-06-05 04:21:00 -04:00
|
|
|
|
private FuncAnimSubmodule funcAnimSm;
|
2026-03-20 12:07:44 -04:00
|
|
|
|
private RuntimeFuncAnim funcAnim;
|
|
|
|
|
|
|
|
|
|
|
|
[Tooltip("是否选择其他功能动画子模块,默认子模块为全身动作子模块。")]
|
|
|
|
|
|
public bool isOtherFuncAnimSm = false;
|
|
|
|
|
|
[Tooltip("如果选择了其他功能动画子模块,则需要指定子模块名称。")]
|
|
|
|
|
|
public string funcAnimSmName = "";
|
|
|
|
|
|
|
|
|
|
|
|
[Tooltip("检测是否正在播放任何功能动画(True),或者指定功能动画名称的动画(False)。")]
|
|
|
|
|
|
public bool checkIsPlayingAny;
|
|
|
|
|
|
|
|
|
|
|
|
[Tooltip("如果检测指定动画,填写功能动画名称。")]
|
|
|
|
|
|
public string animationName;
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnAwake()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnAwake();
|
|
|
|
|
|
funcAnimSm = isOtherFuncAnimSm ? null : animationSc.fullBodyFuncAnimSm;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override TaskStatus OnUpdate()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (funcAnimSm?.currentRuntimeFuncAnim != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (checkIsPlayingAny || funcAnimSm.currentRuntimeFuncAnim.animationName == animationName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return TaskStatus.Success;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return TaskStatus.Failure;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|