//iterate over tree public void iterate(BehaviourNode bn, BehaviourNode parent, BotController bc) { if (bn.getNextNodes() != null) { //Debug.Log("iterating over children"); foreach (BehaviourNode child in bn.getNextNodes()) { if (child != null) { iterate(child, bn, bc); } } } if (parent != null && parent is IFunction) { ((FunctionNode)parent).fillParams(bn.fire(bc)); // should not be like this! //--> if everything is write rewrite fire => fire(bc) } }