public static void Stop(this IBehaviorTreeNode node) { if (node.last_status == BHS.RUNNING) { node.Deinit(); } if (node.last_status != BHS.NONE) { node.Defer(); } node.last_status = BHS.NONE; }
public static BHS Run(this IBehaviorTreeNode node) { if (node.last_status != BHS.RUNNING) { node.Init(); } node.last_status = node.Execute(); if (node.last_status != BHS.RUNNING) { node.Deinit(); } return(node.last_status); }