mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Visual scripting - Added pin disconnect with MMB
Visual scripting - Added min and max node
This commit is contained in:
1 parent
b6e0c0fb66
commit
dc17253518
15 files changed
+164
-21
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Mathematics;
|
||||
|
||||
[Node("Max", "Outputs the largest of the connected numeric values.", "Mathematics", InputType = typeof(Numeric), OutputType = typeof(Numeric))]
|
||||
public class MaxNumericsNode : Node
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public MaxNumericsNode()
|
||||
: base("Max", "Outputs the largest of the connected numeric values.")
|
||||
{
|
||||
Values = CreateInputPinCollection<Numeric>("Values", 2);
|
||||
Max = CreateOutputPin<Numeric>("Max");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public override void Evaluate()
|
||||
{
|
||||
Max.Value = Values.Values.Max();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties & Fields
|
||||
|
||||
public InputPinCollection<Numeric> Values { get; }
|
||||
|
||||
public OutputPin<Numeric> Max { get; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Mathematics;
|
||||
|
||||
[Node("Min", "Outputs the smallest of the connected numeric values.", "Mathematics", InputType = typeof(Numeric), OutputType = typeof(Numeric))]
|
||||
public class MinNumericsNode : Node
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public MinNumericsNode()
|
||||
: base("Min", "Outputs the smallest of the connected numeric values.")
|
||||
{
|
||||
Values = CreateInputPinCollection<Numeric>("Values", 2);
|
||||
Min = CreateOutputPin<Numeric>("Min");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public override void Evaluate()
|
||||
{
|
||||
Min.Value = Values.Values.Min();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties & Fields
|
||||
|
||||
public InputPinCollection<Numeric> Values { get; }
|
||||
|
||||
public OutputPin<Numeric> Min { get; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in new issue
Block a user