Hello,
I am writing a tool script that creates an object whose class inherits Node.
This object can have multiple children (whose class also inherits Node), and it's possible for the user to select one of them in the editor, and delete it.
As there's no notification for deletion in the editor, I'm using NOTIFICATION_UNPARENTED. But this notification is also called when the scene is closed.
I need a way to check whether the child object was deleted specifically by the user, or simply unparented (along with all its siblings) because of the closure of the scene.
Assuming that children are removed according to their index inside the parent (that is: index 0, then 1, then 2, etc.), I'm considering adding a new, empty child at index 0 inside the parent, and checking if this child still exists when one of the others is unparented.
Are children deleted in order of index? Is this reliable behaviour? I think I vaguely remember reading something to this effect, but looking through the docs has not cleared things up.
Thank you.