mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 19:11:32 +00:00
28 lines
582 B
C#
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);
|
|
}
|
|
} |