public override BaseNodeRuntime InstantiateRuntimeNode(GameObject gameObj, Type type) { BaseBehaviourNode node = Activator.CreateInstance(type) as BaseBehaviourNode; node.go = gameObj; node.editorNode = this; runtimeNode = node; return(runtimeNode); }
public override void executeTick() { if (isConditionSatisfied() == false) { return; } if (status == RunStatus.Ready) { onEnter(); } bool canGoOn; for (int i = 0; i < _childrenNodes.Count; i++) { canGoOn = true; BaseBehaviourNode childrenNode = _childrenNodes [i]; RunStatus nodeStatus = childrenNode.status; switch (nodeStatus) { case RunStatus.Ready: case RunStatus.Running: childrenNode.executeTick(); canGoOn = false; break; case RunStatus.Completed: canGoOn = false; status = RunStatus.Completed; return; } if (canGoOn == false) { return; } } status = RunStatus.Failure; return; }
public void addChildren(BaseBehaviourNode children) { _childrenNodes.Add(children); }