How to properly cancel (make inactive) the current node and all children?
Posted: Tue May 31, 2022 10:18 am
How to properly cancel (make inactive) the current node and all children?
Right now I'm trying to do it like this:
StopChecking();
questNode.SetState(QuestNodeState.Active);
for (int i = 0; i < questNode.childList.Count; i++)
{
questNode.childList.SetState(QuestNodeState.Inactive);
questNode.childList.conditionSet.StopChecking();
questNode.childList.SetConditionChecking(false);
}
But the problem is that when canceling child elements, they still continue to check the conditions. That is, the node, if the conditions are met, can go to the True state, even if it is inactive.
The video shows that the canceled node was still executed if its conditions were met.
Right now I'm trying to do it like this:
StopChecking();
questNode.SetState(QuestNodeState.Active);
for (int i = 0; i < questNode.childList.Count; i++)
{
questNode.childList.SetState(QuestNodeState.Inactive);
questNode.childList.conditionSet.StopChecking();
questNode.childList.SetConditionChecking(false);
}
But the problem is that when canceling child elements, they still continue to check the conditions. That is, the node, if the conditions are met, can go to the True state, even if it is inactive.
The video shows that the canceled node was still executed if its conditions were met.