comp.OpeningAnimation = new Animation
{
- Length = TimeSpan.FromSeconds(comp.OpeningAnimationTime),
+ Length = comp.OpeningAnimationTime,
AnimationTracks =
{
new AnimationTrackSpriteFlick
comp.ClosingAnimation = new Animation
{
- Length = TimeSpan.FromSeconds(comp.ClosingAnimationTime),
+ Length = comp.ClosingAnimationTime,
AnimationTracks =
{
new AnimationTrackSpriteFlick
comp.EmaggingAnimation = new Animation
{
- Length = TimeSpan.FromSeconds(comp.EmaggingAnimationTime),
+ Length = comp.EmaggingAnimationTime,
AnimationTracks =
{
new AnimationTrackSpriteFlick
return;
case DoorState.Opening:
- if (entity.Comp.OpeningAnimationTime == 0.0)
+ if (entity.Comp.OpeningAnimationTime == TimeSpan.Zero)
return;
_animationSystem.Play(entity, (Animation)entity.Comp.OpeningAnimation, DoorComponent.AnimationKey);
return;
case DoorState.Closing:
- if (entity.Comp.ClosingAnimationTime == 0.0 || entity.Comp.CurrentlyCrushing.Count != 0)
+ if (entity.Comp.ClosingAnimationTime == TimeSpan.Zero || entity.Comp.CurrentlyCrushing.Count != 0)
return;
_animationSystem.Play(entity, (Animation)entity.Comp.ClosingAnimation, DoorComponent.AnimationKey);
public string EmaggingSpriteState = "sparks";
/// <summary>
- /// The sprite state used for the door when it's open.
+ /// The length of the door's opening animation.
/// </summary>
[DataField]
- public float OpeningAnimationTime = 0.8f;
+ public TimeSpan OpeningAnimationTime = TimeSpan.FromSeconds(0.8);
/// <summary>
- /// The sprite state used for the door when it's open.
+ /// The length of the door's closing animation.
/// </summary>
[DataField]
- public float ClosingAnimationTime = 0.8f;
+ public TimeSpan ClosingAnimationTime = TimeSpan.FromSeconds(0.8);
/// <summary>
- /// The sprite state used for the door when it's open.
+ /// The length of the door's emagging animation.
/// </summary>
[DataField]
- public float EmaggingAnimationTime = 1.5f;
+ public TimeSpan EmaggingAnimationTime = TimeSpan.FromSeconds(1.5);
/// <summary>
/// The animation used when the door opens.