Exemple #1
0
        /// <summary> Converts this node to a SerializableNode </summary>
        public SerializableNode ToSerializedNode()
        {
            SerializableNode n = new SerializableNode();

            n.type              = GetType().FullName;
            n.id                = Id;
            n.X                 = WindowRect.xMin;
            n.Y                 = WindowRect.yMin;
            n.Collapsed         = Collapsed;
            n.directInputValues = new float[Sockets.Count];

            for (var i = 0; i < n.directInputValues.Length; i++)
            {
                if (Sockets[i].IsInput())
                {
                    InputSocket inputSocket = (InputSocket)Sockets[i];
                    if (inputSocket.IsInDirectInputMode())
                    {
                        n.directInputValues[i] = inputSocket.GetDirectInputNumber();
                    }
                }
            }

            n.data = JsonUtility.ToJson(this);             // custom node data can be used
            OnSerialization(n);
            return(n);
        }
Exemple #2
0
        public SerializableNode ToSerializedNode()
        {
            SerializableNode n = new SerializableNode();

            n.type = this.GetType().FullName;
            n.id   = Id;
            n.X    = windowRect.xMin;
            n.Y    = windowRect.yMin;
            n.data = JsonUtility.ToJson(this);
            OnSerialization(n);
            return(n);
        }
Exemple #3
0
 public virtual void OnDeserialization(SerializableNode sNode)
 {
     // for overriding: gets called after this Node has been deserialized
 }
Exemple #4
0
 public virtual void OnSerialization(SerializableNode sNode)
 {
     // for overriding: gets called before this Node gets serialized
 }
Exemple #5
0
 public abstract void OnDeserialization(SerializableNode sNode);
 /// <summary> Converts this node to a SerializableNode </summary>
 public SerializableNode ToSerializedNode()
 {
     SerializableNode n = new SerializableNode();
     n.type = this.GetType().FullName;
     n.id = Id;
     n.X = WindowRect.xMin;
     n.Y = WindowRect.yMin;
     n.data = JsonUtility.ToJson(this); // custom node data can be used
     OnSerialization(n);
     return n;
 }
 public virtual void OnSerialization(SerializableNode sNode)
 {
     // for overriding: gets called before this Node gets serialized
 }
 public virtual void OnDeserialization(SerializableNode sNode)
 {
     // for overriding: gets called after this Node has been deserialized
 }