-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix asyncawait and add ispaused and isstopped
- Loading branch information
Showing
3 changed files
with
75 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Elements.Core; | ||
using FrooxEngine; | ||
using ProtoFlux.Core; | ||
using ProtoFlux.Runtimes.Execution; | ||
|
||
namespace ProtoFlux.Runtimes.Execution.Nodes.Obsidian.Playback | ||
{ | ||
[NodeCategory("Obsidian/Playback")] | ||
[NodeName("IsPaused", false)] | ||
public class IsPaused : ValueFunctionNode<ExecutionContext, bool> | ||
{ | ||
public ObjectInput<IPlayable> Playable; | ||
|
||
protected override bool Compute(ExecutionContext context) | ||
{ | ||
var target = Playable.Evaluate(context); | ||
var isPlaying = target != null && target.IsPlaying; | ||
var isAtStart = MathX.Approximately(target?.NormalizedPosition ?? 0f, 0f); | ||
return !isPlaying && !isAtStart; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Elements.Core; | ||
using FrooxEngine; | ||
using ProtoFlux.Core; | ||
using ProtoFlux.Runtimes.Execution; | ||
|
||
namespace ProtoFlux.Runtimes.Execution.Nodes.Obsidian.Playback | ||
{ | ||
[NodeCategory("Obsidian/Playback")] | ||
[NodeName("IsStopped", false)] | ||
public class IsStopped : ValueFunctionNode<ExecutionContext, bool> | ||
{ | ||
public ObjectInput<IPlayable> Playable; | ||
|
||
protected override bool Compute(ExecutionContext context) | ||
{ | ||
var target = Playable.Evaluate(context); | ||
var isPlaying = target != null && target.IsPlaying; | ||
var isAtStart = MathX.Approximately(target?.NormalizedPosition ?? 0f, 0f); | ||
return !isPlaying && isAtStart; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters