Merge pull request #720 from Artemis-RGB/feature/Nodes

Feature/nodes
This commit is contained in:
RobertBeekman authored and GitHub committed 2022-08-25 22:21:10 +02:00
commit b754efbf50
13 files changed
+752 -1

No files matched your search

@@ -0,0 +1,32 @@
using Artemis.Core;
namespace Artemis.VisualScripting.Nodes.Static;
[Node("Random", "Generates a random value between 0 and 1", "Static", OutputType = typeof(Numeric))]
public class RandomNumericValueNode : Node
{
#region Properties & Fields
private static readonly Random RANDOM = new();
public OutputPin<Numeric> Output { get; }
#endregion
#region Constructors
public RandomNumericValueNode()
: base("Random", "Generates a random value between 0 and 1")
{
Output = CreateOutputPin<Numeric>();
}
#endregion
#region Methods
/// <inheritdoc />
public override void Evaluate() => Output.Value = RANDOM.NextSingle();
#endregion
}