Signal (Event) Subscription and Enter/ExitTree

I’ve been working on creating UI elements for some existing code.

I have 4 docks for various panels, and the main center panel for display.

Anyway I am refactoring the original stuff and realized I may have a logic problem. So currently when a panel for any of the docks exits the tree it unsubscribes to any signals (events) it is subscribed to.

Am I right in assuming that this will be called when the parent dock calls RemoveChild on the docked panel? If that is the case is EnterTree also still called when _Ready() is called? In other words would it work if I subscribe to events in EnterTree?

It would if all the nodes you depend on are already in the tree. It’s typically done in _ready() as it guarantees the existence of all of the nodes in the tree, as well as the execution of all chidlren’s _ready()s