protected override void Definition() { Current = ValueInput <Quaternion>(nameof(Current), Quaternion.identity); Target = ValueInput <Quaternion>(nameof(Target), Quaternion.identity); Speed = ValueInput <float>(nameof(Speed), 5); Output = ValueOutput <Quaternion>(nameof(Output), Process); }
//private bool check; protected override void Definition() { isControlRoot = true; DopeEasingTypeValue = ValueInput(nameof(dopeEasingType), DopeEasingType.Linear); //set valueinput to variable if (dopeTweenInputValueType == DopeTweenInputValueType.Vector3 || dopeTweenInputValueType == DopeTweenInputValueType.Quaternion) { A = ValueInput <Vector3>("A", new Vector3(0f, 0f, 0f)); B = ValueInput <Vector3>("B", new Vector3(0f, 0f, 0f)); } else if (dopeTweenInputValueType == DopeTweenInputValueType.Vector2) { A = ValueInput <Vector2>("A", new Vector2(0f, 0f)); B = ValueInput <Vector2>("B", new Vector2(0f, 0f)); } else if (dopeTweenInputValueType == DopeTweenInputValueType.Color) { A = ValueInput <Color>("A", new Color(0, 0, 0, 1)); B = ValueInput <Color>("B", new Color(1, 1, 1, 1)); } else if (dopeTweenInputValueType == DopeTweenInputValueType.Float) { A = ValueInput <float>("A", 0f); B = ValueInput <float>("B", 0f); } else if (dopeTweenInputValueType == DopeTweenInputValueType.String) { A = ValueInput <string>("A", string.Empty); //B = ValueInput<string>("B", string.Empty); } start = ControlInput(nameof(start), Start); duration = ValueInput(nameof(duration), 1f); unscaledTime = ValueInput(nameof(unscaledTime), false); started = ControlOutput(nameof(started)); tick = ControlOutput(nameof(tick)); completed = ControlOutput(nameof(completed)); ResultValue = ValueOutput(dopeTweenInputValueType == DopeTweenInputValueType.Color ? typeof(Color) : dopeTweenInputValueType == DopeTweenInputValueType.Float ? typeof(float) : dopeTweenInputValueType == DopeTweenInputValueType.String ? typeof(string) : dopeTweenInputValueType == DopeTweenInputValueType.Vector2 ? typeof(Vector2) : dopeTweenInputValueType == DopeTweenInputValueType.Vector3 ? typeof(Vector3) : dopeTweenInputValueType == DopeTweenInputValueType.Quaternion ? typeof(Quaternion) : null, "ResultValue"); Succession(start, started); Succession(start, tick); Succession(start, completed); Requirement(A, start); if (dopeTweenInputValueType != DopeTweenInputValueType.String) { Requirement(B, start); } Requirement(DopeEasingTypeValue, start); Requirement(duration, start); Requirement(unscaledTime, start); Assignment(start, ResultValue); } //Definition
protected override void Definition() { databaseIn = ValueInput <Database>("database"); columnStartIndex = ValueInput <int>("columnStartIndex", 1); rowStartIndex = ValueInput <int>("rowStartIndex", 1); depthStartIndex = ValueInput <int>("depthStartIndex", 1); columns = ValueInput <int>("columns", 1); rows = ValueInput <int>("rows", 1); depth = ValueInput <int>("depth", 1); Func <Recursion, Database> ADatabase = returnA => ReturnA(); A = ValueOutput <Database>("a", ADatabase); Func <Recursion, Database> BDatabase = returnB => ReturnB(); B = ValueOutput <Database>("b", BDatabase); // Relation(databaseIn, enter); Relation(databaseIn, A); Relation(databaseIn, B); Relation(columnStartIndex, A); Relation(columnStartIndex, B); Relation(columns, A); Relation(columns, B); Relation(rowStartIndex, A); Relation(rowStartIndex, B); Relation(rows, A); Relation(rows, B); Relation(depthStartIndex, A); Relation(depthStartIndex, B); Relation(depth, A); Relation(depth, B); }
protected override void Definition() { @this = ValueOutput <IUAClass>("this", (flow) => { return((IUAClass)flow.variables.Get("#secret_uaclass_instance")); }); }
protected override void Definition() { Enter = ControlInput("Enter", (flow) => { delayValue = flow.GetValue <int>(Delay); return(Exit); }); Exit = ControlOutput("Exit"); Delay = ValueInput <int>("Delay", 0); Title = ValueInput <string>("Title", string.Empty); SubTitle = ValueInput <string>("SubTitle", string.Empty); Body = ValueInput <string>("Body", string.Empty); Identifier = ValueOutput <string>("id", (flow) => { id = IosNotify(flow.GetValue <int>(Delay), flow.GetValue <string>(Title), flow.GetValue <string>(SubTitle), flow.GetValue <string>(Body)); return(id); }); Requirement(Title, Enter); Requirement(Body, Enter); Succession(Enter, Exit); }
protected override void Definition() { base.Definition(); ArgumentCount(2); UFoVTarget = ValueOutput("UFoVTarget", delegate { return((UsefulFieldOfViewTarget)arguments[1]); }); }
protected override void Definition() { input = ValueInput(nameof(input), default(T)); output = ValueOutput(nameof(output), Operation); Requirement(input, output); }
public override string GenerateValue(ValueOutput output) { if (output == Unit.selection) { var str = string.Empty; var @true = base.GenerateValue(Unit.ifTrue); var @false = base.GenerateValue(Unit.ifFalse); var condition = base.GenerateValue(Unit.condition); if (Unit.condition.hasValidConnection) { condition = GenerateValue(Unit.condition); } if (Unit.ifTrue.hasValidConnection) { @true = GenerateValue(Unit.ifTrue); } if (Unit.ifFalse.hasValidConnection) { @false = GenerateValue(Unit.ifFalse); } str = "(" + condition + " ? " + @true + " : " + @false + ")"; return(str); } return(base.GenerateValue(output)); }
protected override void Definition() { base.Definition(); Target = ValueInput(typeof(PlayerInput), nameof(Target)); Target.SetDefaultValue(null); Target.NullMeansSelf(); InputAction = ValueInput(typeof(InputAction), nameof(InputAction)); InputAction.SetDefaultValue(default(InputAction)); switch (OutputType) { case OutputType.Button: break; case OutputType.Float: // the getValue delegate is what enables fetching FloatValue = ValueOutput <float>(nameof(FloatValue), _ => m_Value.x); break; case OutputType.Vector2: // the getValue delegate is what enables fetching Vector2Value = ValueOutput <Vector2>(nameof(Vector2Value), _ => m_Value); break; default: throw new ArgumentOutOfRangeException(); } }
protected override void Definition() { arguments = new List <ValueInput>(); if (nonNumeric) { output = ValueOutput <object>(nameof(output), GetObjectValue); for (var i = 0; i < argumentCount; i++) { var argument = ValueInput <object>("Arg_" + i); arguments.Add(argument); BuildRelations(argument); } } else { output = ValueOutput <float>(nameof(output), GetFloatValue); for (var i = 0; i < argumentCount; i++) { var argument = ValueInput <float>("Arg_" + i); argument.SetDefaultValue(GetDefaultValue(typeof(float))); arguments.Add(argument); BuildRelations(argument); } } }
protected override void Definition() { base.Definition(); preIncrement = ValueOutput <float>(nameof(preIncrement), (x) => _preIncrementValue); postIncrement = ValueOutput <float>(nameof(postIncrement), (x) => _postIncrementValue); }
protected override void Definition() { isControlRoot = true; parameters.Clear(); invoke = ControlOutput("invoke"); if (_delegate != null) { @delegate = ValueOutput(_delegate.GetType(), "delegate", (flow) => { var _flow = Flow.New(flow.stack.AsReference()); InitializeDelegate(_flow, _delegate.initialized); return(_delegate); }); for (int i = 0; i < _delegate.parameters.Length; i++) { var index = i; parameters.Add(ValueOutput(_delegate.parameters[i].type, _delegate.parameters[i].name, (flow) => { return(values[index]); })); } } }
protected override void Definition() { input.Clear(); for (int i = 0; i < KeyCount; i++) { var cl = ValueInput <Color>($"色{i}", Color.white); var prog = ValueInput <float>($"位置{i}", (float)i / KeyCount); input.Add(cl); input.Add(prog); } output = ValueOutput <Gradient>(nameof(output), (flow) => { var list = new ArrayList(KeyCount); var grad = new Gradient(); var colorkeys = new GradientColorKey[KeyCount]; var alphakeys = new GradientAlphaKey[KeyCount]; for (int i = 0; i < KeyCount; i++) { var color = flow.GetValue <Color>(input[2 * i]); var time = flow.GetValue <float>(input[2 * i + 1]); colorkeys[i].color = color; colorkeys[i].time = time; alphakeys[i].alpha = color.a; alphakeys[i].time = time; } grad.SetKeys(colorkeys, alphakeys); grad.mode = Mode; return(grad); }); }
protected override void Definition() { Current = ValueInput <Vector3>(nameof(Current), Vector3.zero); Target = ValueInput <Vector3>(nameof(Target), Vector3.zero); Speed = ValueInput <float>(nameof(Speed), 5); Output = ValueOutput <Vector3>(nameof(Output), Process); }
protected override void RegisterPorts() { delegateType = delegateType != null ? delegateType : typeof(Delegate); delegatePort = AddValueOutput(delegateType.FriendlyName(), "Delegate", delegateType, () => { return(reflectedEvent.AsDelegate()); }); callbackPort = AddFlowOutput("Callback"); if (delegateType == typeof(Delegate)) { return; } if (reflectedEvent == null) { reflectedEvent = new ReflectedDelegateEvent(delegateType); reflectedEvent.Add(Callback); } var parameters = delegateType.RTGetDelegateTypeParameters(); for (var _i = 0; _i < parameters.Length; _i++) { var i = _i; var parameter = parameters[i]; AddValueOutput(parameter.Name, "arg" + i, parameter.ParameterType, () => { return(args[i]); }); } }
protected override void Definition() { // Inputs on = ControlInput("on", TurnOn); off = ControlInput("off", TurnOff); if (showMonitored) { monitored = ValueInput <K>("monitored", null); } // Outputs m_trigger = ControlOutput("trigger"); if (showEventArgs) { eventArgs = ValueOutput("eventArgs", (flow) => { return(m_eventArgs); }); } turnedOn = ControlOutput("turnedOn"); turnedOff = ControlOutput("turnedOff"); // Error handling Succession(on, turnedOn); Succession(off, turnedOff); }
protected override void Definition() { base.Definition(); this.CallPerSecond = this.ValueInput <int>("Calls Per Sec"); this.DeltaTime = this.ValueOutput("Delta Time", this.GetDeltaTime).Predictable(); }
protected override void Definition() { W = ValueOutput <float>(nameof(W), new Func <Flow, float>((flow) => UdpReciever.Quaternion[0])).Predictable(); X = ValueOutput <float>(nameof(X), new Func <Flow, float>((flow) => UdpReciever.Quaternion[1])).Predictable(); Y = ValueOutput <float>(nameof(Y), new Func <Flow, float>((flow) => UdpReciever.Quaternion[2])).Predictable(); Z = ValueOutput <float>(nameof(Z), new Func <Flow, float>((flow) => UdpReciever.Quaternion[3])).Predictable(); }
protected override void RegisterPorts() { condition = AddValueInput <bool>("Condition"); isTrue = AddValueInput <T>("Is True", "True"); isFalse = AddValueInput <T>("Is False", "False"); result = AddValueOutput <T>("Result", "Value", () => { return(condition.value ? isTrue.value : isFalse.value); }); }
public override string GenerateValueOutput(ValueOutput output, int indent) { var outputString = string.Empty; if (output == liveUnit.result) { var a = liveUnit.a; var b = liveUnit.b; var entry = (unit.graph.units.ToListPooled().Where((x) => { return((x as EntryUnit) != null); }).ToListPooled()[0] as EntryUnit); var methodInput = entry as MethodInputUnit; GraphReference reference = null; if (methodInput != null) { reference = GraphReference.New(methodInput.macro, BoltX.UnitGuids(methodInput.graph as FlowGraph), false); } var aConnection = a.connection; var bConnection = b.connection; var aSource = aConnection.source; var bSource = bConnection.source; outputString += aConnection != null?aSource.unit.CodeGenerator().GenerateValueOutput(aSource, 0) : Patcher.ActualValue(a.type, Flow.FetchValue(a, a.type, reference)); outputString += CodeBuilder.Operator(BinaryOperator.Or); outputString += bConnection != null?bSource.unit.CodeGenerator().GenerateValueOutput(bSource, 0) : Patcher.ActualValue(b.type, Flow.FetchValue(b, b.type, reference)); } return(outputString); }
protected override void Definition() { enter = ControlInput("enter", new Action <Flow>(StartSequence)); breakIn = ControlInput("break", new Action <Flow>(BreakSequence)); delay = ValueInput <float>("delay", 0).AllowsNull(); unscaled = ValueInput <bool>("unscaled", false); Func <Recursion, float> timeElapsed = getTimeElapsed => TimeElapsed(); elapsed = ValueOutput <float>("elapsed", timeElapsed); Func <Recursion, float> timeRemaining = getTimeRemaining => TimeRemaining(); remaining = ValueOutput <float>("remaining", timeRemaining); entered = ControlOutput("entered"); loop = ControlOutput("loop"); exit = ControlOutput("exit"); breakOut = ControlOutput("broken"); Relation(enter, entered); Relation(enter, loop); Relation(enter, exit); Relation(breakIn, breakOut); }
protected override void Definition() { values.Clear(); if (promoteToInputPort) { binarySave = ValueInput <BinarySave>("binary"); } if (!usePersistantDataPath) { path = ValueInput <string>("path", string.Empty); } fileName = ValueInput <string>("fileName", string.Empty); complete = ControlOutput("complete"); DefineSaveControlPort(); if (!promoteToInputPort) { DefineVariablePorts(); } binarySaveOut = ValueOutput <BinarySave>("_binary", GetBinaryOutput); Requirement(fileName, save); Succession(save, complete); }
protected override void Definition() { damageIn = ValueInput("Damage", 1); attackTypeIn = ValueInput("Type", Attack.AttackType.Light); attackOut = ValueOutput("Attack", GetAttack); }
protected override void Definition() { base.Definition(); value = ValueOutput(variable == null ? typeof(object) : variable.type, "value", (flow) => { IUAClass _target; if (target.hasValidConnection) { _target = flow.GetValue <IUAClass>(target); } else { _target = (IUAClass)flow.variables.Get("#secret_uaclass_instance"); } return(_target.Class.Get(variable.name)); }); if (variable != null) { if (!variable.getUnits.Contains(this)) { variable.getUnits.Add(this); } } Requirement(target, value); }
protected override void Definition() { input = ValueInput <TInput>(nameof(input)); output = ValueOutput(nameof(output), Operation).Predictable(); Requirement(input, output); }
/// <summary> /// Defines the ports of this unit. /// </summary> protected override void Definition() { base.Definition(); arguments.Clear(); enter = ControlInput("enter", Enter); name = ValueInput <string>("name", string.Empty); if (!global) { target = ValueInput <GameObject>("target", (GameObject)null).NullMeansSelf(); } for (int i = 0; i < count; i++) { var input = ValueInput <object>(i.ToString()); arguments.Add(input); Requirement(input, enter); } exit = ControlOutput("exit"); value = ValueOutput <object>("value", GetValue); Succession(enter, exit); Requirement(name, enter); if (!global) { Requirement(target, enter); } Succession(enter, trigger); }
protected override void Definition() { enter = ControlInput("enter", (flow) => { PerformOperation(flow); return(exit); }); collection = ValueInput <IEnumerable>("collection"); exit = ControlOutput("exit"); if (Dictionary) { key = ValueOutput <object>("key"); Assignment(enter, key); } value = ValueOutput <object>("item"); Succession(enter, exit); Assignment(enter, value); Requirement(collection, enter); }
protected override void Definition() { isControlRoot = true; Port = ValueInput <uint>(nameof(Port), 8000); Address = ValueInput <string>(nameof(Address), "/unity"); Received = ControlOutput(nameof(Received)); Value = ValueOutput <Vector4>(nameof(Value), GetValue); }
protected override void Definition() { Seed = ValueInput <uint>(nameof(Seed), 0); Data = ValueInput <uint>(nameof(Data), 0); Min = ValueInput <int>(nameof(Min), 0); Max = ValueInput <int>(nameof(Max), 10); Output = ValueOutput <int>(nameof(Output), GetOutput); }
protected override void Definition() { values.Clear(); DefineVariablePorts(); binarySave = ValueOutput <BinarySave>("_binary", GetBinaryOutput); }