feat(dialog): 添加精灵动效 Yarn 命令

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-10 22:33:05 +08:00
co-authored by Cursor
parent 18d6d970f9
commit 8d1f072d55
@@ -92,6 +92,27 @@ namespace AibisDream
yield return SpriteShowcase.Instance.ShowObj(picName, duration);
}
[YarnCommand("show_sprite_motion")]
public static IEnumerator ShowSpriteMotion(string picName, string motionProfile, float duration = 0.35f)
{
var showcase = SpriteShowcase.Instance;
if (showcase == null) yield break;
yield return showcase.ShowObjWithMotion(picName, motionProfile, duration);
}
[YarnCommand("sprite_motion")]
public static IEnumerator SpriteMotion(string motionProfile, float leadDuration = 0.18f)
{
var showcase = SpriteShowcase.Instance;
if (showcase == null) yield break;
showcase.PlayCurrentMotion(motionProfile);
if (leadDuration > 0f)
{
yield return new WaitForSeconds(leadDuration);
}
}
[YarnCommand("hide_sprite")]
public static IEnumerator HideSprite(float duration = 1)
{
@@ -209,4 +230,4 @@ namespace AibisDream
#endregion
}
}
}