///Invokes the function and callbacks when a Return node is hit.
 public void InvokeAsync(Flow f, FlowHandler Callback, params object[] args)
 {
     this.args    = args;
     f.ReturnType = returns.type;
     f.Return     = (o) => { this.returnValue = o; Callback(f); };
     onInvoke.Call(f);
 }
Exemplo n.º 2
0
 public FlowInput AddFlowInput(string name, FlowHandler pointer, string ID = "")
 {
     if (string.IsNullOrEmpty(ID))
     {
         ID = name;
     }
     return((FlowInput)(_inputPorts[ID] = new FlowInput(this, name, ID, pointer)));
 }
        ///Invokes the function and callbacks when a Return node is hit.
        public void InvokeAsync(Flow f, FlowHandler flowCallback, params object[] args)
        {
            this.args = args;
            FlowReturn returnCallback = (o) => { this.returnValue = o; flowCallback(f); };
            var        invocationFlow = new Flow();

            invocationFlow.SetReturnData(returnCallback, returns.type);
            onInvoke.Call(invocationFlow);
        }
Exemplo n.º 4
0
 ///Invokes the function and callbacks when a Return node is hit.
 public void InvokeAsync(Flow f, FlowHandler Callback, params object[] args)
 {
     if (isInvoking)
     {
         Logger.LogWarning("Invoking a custom function which is already running is currently not supported.", "Execution", this);
         return;
     }
     this.args  = args;
     isInvoking = true;
     f.PushReturnData((o) => { this.returnValue = o; isInvoking = false; Callback(f); }, returns.type);
     onInvoke.Call(f);
 }
Exemplo n.º 5
0
        public FlowIn AddFlowIn(string name, FlowHandler flowHandler)
        {
            FlowIn fi;
            if (!flowInDict.TryGetValue(name, out fi))
            {
                fi = new FlowIn(this, name);
                flowInDict.Add(name, fi);
            }

            fi.SetFlowHandler(flowHandler);
            return fi;
        }
        ///Invokes the function and callbacks when a Return node is hit.
        public void InvokeAsync(Flow f, FlowHandler flowCallback, params object[] args)
        {
            if (isInvoking)
            {
                Logger.LogWarning("Invoking a Custom Function which is already running.", "Execution", this);
            }
            this.args  = args;
            isInvoking = true;
            FlowReturn returnCallback = (o) => { this.returnValue = o; isInvoking = false; flowCallback(f); };
            var        invocationFlow = new Flow();

            invocationFlow.SetReturnData(returnCallback, returns.type);
            onInvoke.Call(invocationFlow);
        }
Exemplo n.º 7
0
 public FlowInput(FlowNode parent, string name, string ID, FlowHandler pointer)
     : base(parent, name, ID)
 {
     this.pointer = pointer;
 }
Exemplo n.º 8
0
 ///Appends a delegate when port is called
 public void Append(FlowHandler action)
 {
     this.pointer += action;
 }
Exemplo n.º 9
0
 ///Binds the port to a delegate directly
 public void BindTo(FlowHandler call)
 {
     this.pointer = call;
 }
 ///Invokes the function and callbacks when a Return node is hit.
 public void InvokeAsync(Flow f, FlowHandler Callback, params object[] args)
 {
     this.args = args;
     f.PushReturnData((o) => { this.returnValue = o; Callback(f); }, returns.type);
     onInvoke.Call(f);
 }
Exemplo n.º 11
0
 ///Appends a callback when port is called
 public void Append(FlowHandler callback)
 {
     this.pointer += callback;
 }
Exemplo n.º 12
0
 public void SetFlowHandler(FlowHandler flowHandler)
 {
     this.flowHandler = flowHandler;
 }
Exemplo n.º 13
0
 public FlowInput AddFlowInput(string name, FlowHandler pointer, string ID = "")
 {
     QualifyPortNameAndID(ref name, ref ID, inputPorts);
     return((FlowInput)(inputPorts[ID] = new FlowInput(this, name, ID, pointer)));
 }
Exemplo n.º 14
0
        ///---------------------------------------------------------------------------------------------
        //Port registration/definition methods, to be used within RegisterPorts override

        ///Add a new FlowInput with name and pointer. Pointer is the method to run when the flow port is called. Returns the new FlowInput object.
        public FlowInput AddFlowInput(string name, string ID, FlowHandler pointer)
        {
            return(AddFlowInput(name, pointer, ID));
        }
Exemplo n.º 15
0
 void Awake()
 {
     flow = GetComponent <FlowHandler> ();
 }