public BehaviorTreeData GetBehaviorTreeData(int id) { BehaviorTreeData tree_data = null; if (!m_behavior_tree_data.TryGetValue(id, out tree_data)) { return(null); } return(tree_data); }
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); }