I’m having trouble understanding how all the Node SetEnabled variants work.
First problem is:
/// Set enabled state on self and child nodes. Nodes' own enabled state is remembered (IsEnabledSelf) and can be restored. void Node::SetDeepEnabled(bool enable) { SetEnabled(enable, true, false); }
The comment says the node remembers is current state which can be restored later, however the 3rd parameter to the SetEnabled function which flags whether to remember its state or not, is actually false.
Second problem:
void Node::SetEnabled(bool enable, bool recursive, bool storeSelf)
{
…if (storeSelf) enabledPrev_ = enable; if (enable != enabled_) {
The function is not storing its current state, but the new state which is passed on as a parameter. Shouldn’t it be:
if (storeSelf) enabledPrev_ = enabled_;
So, either I don’t understand how this code works or there are some serious bugs! Can someone clarify? Thanks.