protected override void Definition() { target = ValueInput <SMachine>("target", (SMachine)null); target.NullMeansSelf(); asset = ValueInput <ScriptGraphAsset>("asset", (ScriptGraphAsset)null); result = ValueOutput <bool>("machine", (flow) => { var macro = flow.GetValue <SMachine>(target)?.nest.macro; if (macro != null) { return(macro == flow.GetValue <ScriptGraphAsset>(asset)); } return(false); }); }
protected override void Definition() { target = ValueInput <GameObject>("target", (GameObject)null); target.NullMeansSelf(); asset = ValueInput <ScriptGraphAsset>("asset", (ScriptGraphAsset)null); machines = ValueOutput <SMachine[]>("machine", (flow) => { var machines = flow.GetValue <GameObject>(target).GetComponents <SMachine>(); var _machines = new List <SMachine>(); for (int i = 0; i < machines.Length; i++) { if (machines[i].nest.macro == flow.GetValue <ScriptGraphAsset>(asset)) { _machines.Add(machines[i]); } } return(_machines.ToArrayPooled()); }); }
protected override void Definition() { target = ValueInput <SMachine>("target", (SMachine)null); target.NullMeansSelf(); name = ValueInput <string>("name", defaultName); }