Maze / Library /PackageCache /com.unity.visualscripting@1.8.0 /Runtime /VisualScripting.Flow /Framework /Math /Absolute.cs
| namespace Unity.VisualScripting | |
| { | |
| [] | |
| public abstract class Absolute<TInput> : Unit | |
| { | |
| /// <summary> | |
| /// The value to make positive. | |
| /// </summary> | |
| [] | |
| [] | |
| public ValueInput input { get; private set; } | |
| /// <summary> | |
| /// The positive value. | |
| /// </summary> | |
| [] | |
| [] | |
| public ValueOutput output { get; private set; } | |
| protected override void Definition() | |
| { | |
| input = ValueInput<TInput>(nameof(input)); | |
| output = ValueOutput(nameof(output), Operation).Predictable(); | |
| Requirement(input, output); | |
| } | |
| protected abstract TInput Operation(TInput input); | |
| public TInput Operation(Flow flow) | |
| { | |
| return Operation(flow.GetValue<TInput>(input)); | |
| } | |
| } | |
| } | |