namespace Unity.VisualScripting { [UnitOrder(402)] public abstract class Distance : Unit { /// /// The first vector. /// [DoNotSerialize] public ValueInput a { get; private set; } /// /// The second vector. /// [DoNotSerialize] public ValueInput b { get; private set; } /// /// The distance between A and B. /// [DoNotSerialize] [PortLabelHidden] public ValueOutput distance { get; private set; } protected override void Definition() { a = ValueInput(nameof(a)); b = ValueInput(nameof(b)); distance = ValueOutput(nameof(distance), Operation).Predictable(); Requirement(a, distance); Requirement(b, distance); } private float Operation(Flow flow) { return Operation(flow.GetValue(a), flow.GetValue(b)); } public abstract float Operation(T a, T b); } }