mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 13:37:47 +03:00
* generic animation * AnimateOnHit * Dynamic Value * AnimateOnStartup * Animated Emotes * Play Animation Command * RedFox review * Rabbit review * RedFox review * PlayClient * Rabbit review * RedFox review
25 lines
703 B
C#
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;
|
|
}
|
|
}
|