namespace Unity.VisualScripting { [UnitOrder(406)] public abstract class Project : Unit { /// /// The vector to project. /// [DoNotSerialize] public ValueInput a { get; private set; } /// /// The vector on which to project. /// [DoNotSerialize] public ValueInput b { get; private set; } /// /// The projection of A on B. /// [DoNotSerialize] [PortLabelHidden] public ValueOutput projection { get; private set; } protected override void Definition() { a = ValueInput(nameof(a)); b = ValueInput(nameof(b)); projection = ValueOutput(nameof(projection), Operation).Predictable(); Requirement(a, projection); Requirement(b, projection); } private T Operation(Flow flow) { return Operation(flow.GetValue(a), flow.GetValue(b)); } public abstract T Operation(T a, T b); } }