예제 #1
0
    private void Update()
    {
        if (backingValue != null && isBasicTypePort && port.IsInput)
        {
            if (!port.IsConnected && !backingValue.gameObject.activeInHierarchy)
            {
                backingValue.gameObject.SetActive(true);

                if (port.IsStatic)
                {
                    backingValue.SetData(ReflectionUtilities.GetValueOf(new List <string>(backingValuePath.Split('/')), node), backingValuePath, propertyType);
                    backingValue.OnValueChanged.AddListener(ValueChanged);
                }
                else if (node is NTNode)
                {
                    NTNode n   = (NTNode)node;
                    object val = n.GetInstancePortValue(fieldName);
                    val = val != null ? val : Activator.CreateInstance(port.ValueType);

                    backingValue.SetData(val, backingValuePath, propertyType);
                    backingValue.OnValueChanged.AddListener(InstanceValueChanged);
                }
            }
            else if (port.IsConnected && backingValue.gameObject.activeInHierarchy)
            {
                backingValue.gameObject.SetActive(false);
                backingValue.OnValueChanged.RemoveListener(ValueChanged);
            }
        }
    }
        public override NodeExecutionContext NextNode(NodeExecutionContext context)
        {
            NTNode   node = GetNode(nameof(flowOut));
            NodePort port = GetPort(nameof(flowOut));

            return(new NodeExecutionContext {
                node = node, inputPort = port?.Connection, outputPort = port
            });
        }
        public override NodeExecutionContext NextNode(NodeExecutionContext context)
        {
            Debug.Log("Next node from branch??");

            bool condition = GetInputValue <bool>(nameof(condition), this.condition);

            string nemeOfPort = condition ? nameof(trueBranch) : nameof(falseBranch);

            Debug.Log(nemeOfPort);

            NTNode   node = GetNode(nemeOfPort);
            NodePort port = GetPort(nemeOfPort);

            return(new NodeExecutionContext {
                node = node, inputPort = port?.Connection, outputPort = port
            });
        }
예제 #4
0
 static CypherCoercions()
 {
     _converters[NTAny.GetType()]             = (a, ignore1, ignore2) => a;
     _converters[NTString.GetType()]          = (a, ignore1, ignore2) => AsTextValue(a);
     _converters[NTNumber.GetType()]          = (a, ignore1, ignore2) => AsNumberValue(a);
     _converters[NTInteger.GetType()]         = (a, ignore1, ignore2) => AsIntegralValue(a);
     _converters[NTFloat.GetType()]           = (a, ignore1, ignore2) => AsFloatingPointValue(a);
     _converters[NTBoolean.GetType()]         = (a, ignore1, ignore2) => AsBooleanValue(a);
     _converters[NTMap.GetType()]             = (a, ignore, c) => AsMapValue(a, c);
     _converters[NTNode.GetType()]            = (a, ignore1, ignore2) => AsNodeValue(a);
     _converters[NTRelationship.GetType()]    = (a, ignore1, ignore2) => AsRelationshipValue(a);
     _converters[NTPath.GetType()]            = (a, ignore1, ignore2) => AsPathValue(a);
     _converters[NTGeometry.GetType()]        = (a, ignore1, ignore2) => AsPointValue(a);
     _converters[NTPoint.GetType()]           = (a, ignore1, ignore2) => AsPointValue(a);
     _converters[NTDateTime.GetType()]        = (a, ignore1, ignore2) => AsDateTimeValue(a);
     _converters[NTLocalDateTime.GetType()]   = (a, ignore1, ignore2) => AsLocalDateTimeValue(a);
     _converters[NTDate.GetType()]            = (a, ignore1, ignore2) => AsDateValue(a);
     _converters[NTTime.GetType()]            = (a, ignore1, ignore2) => AsTimeValue(a);
     _converters[NTLocalTime.GetType()]       = (a, ignore1, ignore2) => AsLocalTimeValue(a);
     _converters[NTDuration.GetType()]        = (a, ignore1, ignore2) => AsDurationValue(a);
     _converters[typeof(Neo4jTypes.ListType)] = new ListCoercer();
 }
예제 #5
0
    private void InstanceValueChanged(object value, string path)
    {
        NTNode n = (NTNode)node;

        n.SetInstancePortValue(path, value);
    }