quantum-space-buddies/QSB/Animation/Player/Messages/AnimationTriggerMessage.cs
2022-03-10 17:57:50 -08:00

28 lines
582 B
C#

using QSB.Messaging;
using QSB.Player;
using QSB.WorldSync;
namespace QSB.Animation.Player.Messages;
internal class AnimationTriggerMessage : QSBMessage<string>
{
public AnimationTriggerMessage(string name) : base(name) { }
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
public override void OnReceiveRemote()
{
var animationSync = QSBPlayerManager.GetPlayer(From).AnimationSync;
if (animationSync == null)
{
return;
}
if (animationSync.VisibleAnimator == null)
{
return;
}
animationSync.VisibleAnimator.SetTrigger(Data);
}
}