Skip to content

Commit

Permalink
Update Local Stopwatch.cs
Browse files Browse the repository at this point in the history
Removed conditional
  • Loading branch information
Xlinka committed Dec 13, 2024
1 parent fee5437 commit a081a15
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions ProjectObsidian/ProtoFlux/Flow/Time/Local Stopwatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public class LocalStopwatch : VoidNode<FrooxEngineContext>
private double _elapsedTime = 0.0;
private bool _isRunning = false;

public readonly ValueInput<bool> Condition;

public LocalStopwatch()
{
ElapsedTime = new ValueOutput<float>(this);
Expand All @@ -46,11 +44,8 @@ protected override void ComputeOutputs(FrooxEngineContext context)
{
double currentTime = context.World.Time.WorldTime;

// Check if Condition is true
bool conditionMet = Condition.Evaluate(context); // Directly read the value of Condition

// Update elapsed time if running and condition is true
if (_isRunning && conditionMet)
// Update elapsed time if running
if (_isRunning)
{
if (_startTime > 0)
{
Expand All @@ -68,12 +63,6 @@ protected override void ComputeOutputs(FrooxEngineContext context)
IsRunning.Write(_isRunning, context);
}







private IOperation DoStart(FrooxEngineContext context)
{
_isRunning = true;
Expand All @@ -98,4 +87,4 @@ private IOperation DoReset(FrooxEngineContext context)
return OnReset.Target;
}
}
}
}

0 comments on commit a081a15

Please sign in to comment.