(965c31410) v0.10.4.0

This commit is contained in:
Joonas Rikkonen
2020-07-30 13:00:09 +03:00
parent eeac247a8e
commit 4978af3d60
539 changed files with 45803 additions and 25359 deletions
@@ -0,0 +1,38 @@
using System;
using System.Xml.Linq;
namespace Barotrauma
{
class WaitAction : EventAction
{
[Serialize(0.0f, true)]
public float Time { get; set; }
private float timeRemaining;
public WaitAction(ScriptedEvent parentEvent, XElement element) : base(parentEvent, element)
{
timeRemaining = Time;
}
public override bool IsFinished(ref string goTo)
{
return timeRemaining <= 0;
}
public override void Reset()
{
timeRemaining = Time;
}
public override void Update(float deltaTime)
{
timeRemaining -= deltaTime;
if (timeRemaining < 0.0f) { timeRemaining = 0.0f; }
}
public override string ToDebugString()
{
return $"{ToolBox.GetDebugSymbol(timeRemaining <= 0)} {nameof(WaitAction)} -> (Remaining: {timeRemaining.ColorizeObject()}, Time: {Time.ColorizeObject()})";
}
}
}