/// <summary>
        /// Sets the wrapped value based on the specified type.
        /// </summary>
        public void SetValueWrapperFromType(Type wrappedValueType)
        {
            if (wrappedValueType == WrappedType)
            {
                return;
            }

            PreTypeChanged.InvokeSafe(new NodeGraphVariableTypeChangeEvent(this, WrappedType, wrappedValueType));

            NodeEditor.Assertions.IsNotNull(wrappedValueType);
            var classType = typeof(NodeValueWrapper <>).MakeGenericType(wrappedValueType);

            WrappedValue = Activator.CreateInstance(classType) as NodeValueWrapper;

            PostTypeChanged.InvokeSafe(new NodeGraphVariableTypeChangeEvent(this, WrappedType, wrappedValueType));
        }
 public void Remove()
 {
     Removed.InvokeSafe(this);
     WrappedValue = null;
 }
 public NodePinWrapper(NodePin pin, NodeValueWrapper valueWrapper) : base(pin, valueWrapper)
 {
 }
        public static NodePinValueWrapper Instantiate(NodePin pin, NodeValueWrapper valueWrapper)
        {
            var classType = typeof(NodePinWrapper <>).MakeGenericType(valueWrapper.ValueType);

            return(Activator.CreateInstance(classType, pin, valueWrapper) as NodePinValueWrapper);
        }
 public NodePinValueWrapper(NodePin pin, NodeValueWrapper valueWrapper)
 {
     Pin          = pin;
     ValueWrapper = valueWrapper;
 }
Пример #6
0
 void ValueWrapper_Changed(NodeValueWrapper valueWrapper)
 {
     TriggerChange();
 }