Files
wwdpublic/Content.Client/_White/Animations/Systems/AnimateOnStartupSystem.cs
Spatison 8e5d669987 Generic animations (#1067)
* generic animation

* AnimateOnHit

* Dynamic Value

* AnimateOnStartup

* Animated Emotes

* Play Animation Command

* RedFox review

* Rabbit review

* RedFox review

* PlayClient

* Rabbit review

* RedFox review
2026-02-13 21:40:44 +02:00

25 lines
703 B
C#

using Content.Shared._White.Animations.Components;
namespace Content.Client._White.Animations.Systems;
public sealed class AnimateOnStartupSystem : EntitySystem
{
[Dependency] private readonly WhiteAnimationPlayerSystem _whiteAnimationPlayer = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<AnimateOnStartupComponent, ComponentStartup>(OnStartup);
}
private void OnStartup(Entity<AnimateOnStartupComponent> ent, ref ComponentStartup args)
{
if (ent.Comp is { Played: true, Force: false, })
return;
_whiteAnimationPlayer.Play(ent, ent.Comp.Animation);
ent.Comp.Played = true;
}
}