IEnumerator Execute(Flow flow) { ExecutionContext context = flow.Context; float time; float t = 0; float delta; var tickOut = GetFlowOutput("tick"); isRunning = true; Status = FlowNodeStaus.Waiting; while (true) { DiryAllValueInputNodes(flow); ExecuteAllValueInputNode(context, this, flow); time = timeIn.GetValue(flow.Context); if (t >= time) { break; } delta = (float)deltaIn.GetValue(flow.Context, deltaIn.ValueType); if (tickOut.LinkInput != null) { elapsedOut.SetValue(t); tickOut.Execute(flow); } t += delta; yield return(null); } isRunning = false; if (Status == FlowNodeStaus.Waiting) { Status = FlowNodeStaus.Complete; elapsedOut.SetValue(t); var doneOut = GetFlowOutput("done"); doneOut.Execute(flow); } }
public override void ExecuteContent(Flow flow) { ExecutionContext context = flow.Context; Transform root; root = rootIn.GetValue(context); Component result = null; if (root) { result = FindComponent(root, nameIn.GetValue(context), typeNameIn.GetValue(context)); } resultOut.SetValue(result); }
public override void ExecuteContent(Flow flow) { object instance = thisIn.GetValue(flow.Context); if (member == null) { if (instance == null) { Debug.LogError("Set Instance null"); return; } Type instanceType = instance.GetType(); member = instanceType.GetField(property); if (member == null) { member = instanceType.GetProperty(property); } if (member == null) { Debug.LogError("Member null " + property); } } if (member == null) { return; } object value; if (member.MemberType == MemberTypes.Property) { PropertyInfo pInfo = (PropertyInfo)member; value = pInfo.GetSetMethod().Invoke(instance, null); } else { FieldInfo fInfo = (FieldInfo)member; value = fInfo.GetValue(instance); } valueOut.SetValue(value); }
public override void ExecuteContent(Flow flow) { ExecutionContext context = flow.Context; Transform result = null; string name = nameIn.GetValue(context); if (!string.IsNullOrEmpty(name)) { Transform root; root = rootIn.GetValue(context); if (root) { result = FindTransform(root, name); } } resultOut.SetValue(result); }
public override void ExecuteContent(Flow flow) { object value; object instance = null; FieldInfo field = Field; if (!field.IsStatic) { instance = ThisIn.GetValue(flow.Context); if (instance == null) { throw new Exception("get field error, instance null. field: " + field); } } value = field.GetValue(instance); valueOut.SetValue(value); }
public override void ExecuteContent(Flow flow) { object value; object instance = null; PropertyInfo property = Property; var getter = property.GetGetMethod(); if (!IsStatic) { instance = ThisIn.GetValue(flow.Context); if (instance == null) { throw new Exception("instance null"); } } value = getter.Invoke(instance, null); valueOut.SetValue(value); }