Add a behavior tree to the enemy

Add the Beehave addon.
Make the enemy do the same thing as before but with a behavior tree.
This commit is contained in:
Mathilde Grapin 2023-06-12 16:48:35 +02:00
parent 09f6925a00
commit 1aed988149
92 changed files with 4025 additions and 25 deletions

View file

@ -0,0 +1,22 @@
@tool
class_name BeehaveUtils
static func get_plugin() -> EditorPlugin:
var tree: SceneTree = Engine.get_main_loop()
return tree.get_root().get_child(0).get_node_or_null("BeehavePlugin")
static func get_editor_scale() -> float:
var plugin := get_plugin()
if plugin:
return plugin.get_editor_interface().get_editor_scale()
return 1.0
static func get_frames() -> RefCounted:
var plugin := get_plugin()
if plugin:
return plugin.frames
push_error("Can't find Beehave Plugin")
return null