Compile BehaviorTree only into "tools" builds

This commit is contained in:
Serhii Snitsaruk 2023-04-27 09:41:59 +02:00
parent 9c1d0009ba
commit 62310a75df
3 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,7 @@
/* behavior_tree_view.cpp */
#ifdef TOOLS_ENABLED
#include "behavior_tree_view.h"
#include "behavior_tree_data.h"
#include "core/math/color.h"
@ -157,3 +159,5 @@ BehaviorTreeView::BehaviorTreeView() {
tree->connect(SNAME("item_collapsed"), callable_mp(this, &BehaviorTreeView::_item_collapsed));
}
#endif // TOOLS_ENABLED

View File

@ -1,5 +1,7 @@
/* behavior_tree_view.h */
#ifdef TOOLS_ENABLED
#ifndef BEHAVIOR_TREE_VIEW_H
#define BEHAVIOR_TREE_VIEW_H
@ -42,4 +44,6 @@ public:
BehaviorTreeView();
};
#endif // BEHAVIOR_TREE_VIEW
#endif // BEHAVIOR_TREE_VIEW
#endif // TOOLS_ENABLED

View File

@ -168,8 +168,6 @@ void initialize_limboai_module(ModuleInitializationLevel p_level) {
GDREGISTER_CLASS(BBVector3Array);
GDREGISTER_CLASS(BBVariant);
GDREGISTER_CLASS(BehaviorTreeView);
_limbo_utility = memnew(LimboUtility);
GDREGISTER_CLASS(LimboUtility);
@ -180,7 +178,10 @@ void initialize_limboai_module(ModuleInitializationLevel p_level) {
#ifdef TOOLS_ENABLED
if (p_level == MODULE_INITIALIZATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<LimboAIEditorPlugin>();
} else if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) {
GDREGISTER_CLASS(BehaviorTreeView);
}
#endif
}