Files
LuaCsForBarotraumaEP/Subsurface/Source/Events/ScriptedTask.cs
Regalis 85b0cda4ca v0.1
2015-07-31 21:05:55 +03:00

33 lines
826 B
C#

namespace Subsurface
{
class ScriptedTask : Task
{
private ScriptedEvent scriptedEvent;
private bool prevStarted;
public ScriptedTask(ScriptedEvent scriptedEvent)
: base(scriptedEvent.Difficulty, scriptedEvent.Name)
{
if (taskManager == null) return;
this.musicType = scriptedEvent.MusicType;
this.scriptedEvent = scriptedEvent;
scriptedEvent.Init();
}
public override void Update(float deltaTime)
{
if (prevStarted == false && scriptedEvent.IsStarted)
{
taskManager.TaskStarted(this);
prevStarted = true;
}
scriptedEvent.Update(deltaTime);
if (scriptedEvent.IsFinished) Finished();
}
}
}