Closed jangofett890 closed 6 years ago
I think you have to put
[SerializeField]
in front of the string because it is private, so
[SerializeField] string value;
I would suggest moving the = ""
part to the OnCreate function also.
Ok well that fixed it, I had believed that the value was stored in the Knob itself not in the variables in the node. That wasn't really explained in the Documentation, and the forum thread listed on the site is for general discussion of node editors rather than the framework itself.
Mark this Issue as closed please
You have to set the value on the knob to store it there. I think it would be something like this
outputknob.SetValue<string> (value);
However, I think that is a runtime thing and will not be saved with the canvas.
I have that under calculate already in the code provided, changing the string value to public is what fixed it.
Yes, @Quyrean is correct, knob values are only runtime, storing in the node is the correct way to do this. I didn't think in needed to be put in the docs, but I will consider adding it. Seneral
I have been extending the node editor, trying to get a handle on things and decided to make a simple string input node, however when the editor closes the string value put into the node is lost upon reopening, this does not happen with the float input node and the classes are almost identical.
My node class is here: `
`