Files
BH3/Assets/Plugins/Assembly-CSharp-firstpass/CinemaDirector/BlendAnimationEvent.cs
2025-08-13 09:26:42 +08:00

31 lines
628 B
C#

using UnityEngine;
namespace CinemaDirector
{
[CutsceneItem("Animation", "Blend Animation", new CutsceneItemGenre[] { CutsceneItemGenre.ActorItem })]
public class BlendAnimationEvent : CinemaActorEvent
{
public string Animation = string.Empty;
public float TargetWeight = 1f;
public float FadeLength = 0.3f;
public override void Trigger(GameObject actor)
{
if (actor != null)
{
Animation component = actor.GetComponent<Animation>();
if ((bool)component)
{
component.Blend(Animation, TargetWeight, FadeLength);
}
}
}
public override void Reverse(GameObject actor)
{
}
}
}