35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using System.Collections;
|
|
using Yarn.Unity;
|
|
|
|
namespace AibisDream
|
|
{
|
|
// Yarn 命令说明见同目录 AnimatorYarnCommand.md
|
|
public static class AnimatorYarnCommand
|
|
{
|
|
[YarnCommand("play_animation")]
|
|
public static IEnumerator PlayAnimation(string animatorName, string stateName)
|
|
{
|
|
yield return AnimatorCenter.Instance.PlayAnimationAsync(animatorName, stateName);
|
|
}
|
|
|
|
[YarnCommand("play_animation_addressable")]
|
|
public static IEnumerator PlayAnimationAddressable(string animatorName, string addressableKey, string stateName)
|
|
{
|
|
yield return AnimatorCenter.Instance.PlayAnimationFromAddressableAsync(animatorName, addressableKey,
|
|
stateName);
|
|
}
|
|
|
|
[YarnCommand("reset_animation")]
|
|
public static void ResetAnimation(string animatorName)
|
|
{
|
|
AnimatorCenter.Instance.ResetAnimation(animatorName);
|
|
}
|
|
|
|
[YarnCommand("hide_animation")]
|
|
public static void HideAnimation(string animatorName)
|
|
{
|
|
AnimatorCenter.Instance.HideAnimation(animatorName);
|
|
}
|
|
}
|
|
}
|