Exemplo n.º 1
0
 public static BehaviorNodeConfig AddChild(this BehaviorTreeConfig treeConfig, BehaviorNodeConfig parent, BehaviorNodeConfig child)
 {
     child.transform.parent = parent.transform;
     child.transform.SetAsLastSibling();
     child.GetComponent <BehaviorNodeConfig>().id = treeConfig.RootNodeId + treeConfig.AutoId;
     return(child.GetComponent <BehaviorNodeConfig>());
 }
Exemplo n.º 2
0
        public static BehaviorNodeConfig AddRootNode(this BehaviorTreeConfig treeConfig, string rootName)
        {
            BehaviorNodeConfig go = treeConfig.CreateNodeConfig(rootName);

            treeConfig.RootNodeConfig    = go.GetComponent <BehaviorNodeConfig>();
            treeConfig.RootNodeConfig.id = BTEditor.NodeIdStartIndex;
            go.gameObject.name           = rootName;
            return(go);
        }