BehaviorTree CreateBeahviorTreeFromConfig(int bt_config_id) { BehaviorTreeData data = m_config_provider.GetBehaviorTreeData(bt_config_id); if (data == null) { return(null); } BehaviorTree tree = new BehaviorTree(bt_config_id); for (int i = 0; i < data.m_entry_nodes.Count; ++i) { BTNode entry_node = CreateBTNode(data.m_entry_nodes[i]); if (entry_node != null) { tree.AddEntry(entry_node, data.m_entry_nodes[i].m_extra_data); } } tree.SetSignalData(data.m_signal_datas); tree.SetEventData(data.m_event_datas); return(tree); }