Replies: 1 comment
-
In 4.0 this is possible: var a:
get: return get_value("a")
set(value): set_value("a", value)
var b:
get: return get_value("b")
set(value): set_value("b", value)
var _values = {}
func get_value(key):
return _values.get(key)
func set_value(key, value):
_values[key] = value
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was working on a tool node with multiple exported variables and I wanted to send a signal (to update some graphics in the editor) whenever a variable's value is changed.
As of now I am forced to create a method for each variable as I am forced to update a variable value manually once I define a setter and have no way to tell which variable is being updated:
I tried to use the _set method but it's not getting called in tool mode.
One possible solution could be to modify the setter function to allow 2 parameters, where the second one is the name of the script variable (in the same fashion of _set), that would make possible to do something like this:
Beta Was this translation helpful? Give feedback.
All reactions