I am making an editor plugin, and I want to keep track of the custom node's children by having an exported array or dictionary of PackedScene objects. I want to make it so that when I add a new PackedScene to the array, or reorder the array, it calls a function so that I can reorganise the node's children. Is this even possible? I know I could create custom functions that either append to the array or change the position of one of its members and then does what it needs to with the node children, but since it's an editor plugin, I want this to happen not only at runtime, but also when you edit the array in the inspector. Please let me know if this has an existing solution 🙏
#Call function when an array changes?
1 messages · Page 1 of 1 (latest)
Setters and getters are probably your best bet. Not sure how/if those work in a script with @tool though.
Let's say they do, would set be called when you add to an array or change the order? Isn't set only for setting the entire variable?
I've only used them for ints and bools so far, I would say try and see? And report back. 😉
It actually appears as though it does!