/// <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); }
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 }