From 1f82ffa4d3ee8355215d43bf43edf8cecaca0d1d Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 16 Oct 2024 17:21:04 +0200 Subject: fix user script implementation --- src/example/script.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/example/script.cpp') diff --git a/src/example/script.cpp b/src/example/script.cpp index b8b3c8d..95c4950 100644 --- a/src/example/script.cpp +++ b/src/example/script.cpp @@ -8,15 +8,16 @@ #include #include +#include #include using namespace crepe; using namespace crepe::api; using namespace std; -class MyScript : public BehaviorScript { +class MyScript : public Script { void update() { - dbg_trace(); + dbg_log("MY SCRIPT UPDATE"); } }; @@ -24,7 +25,7 @@ int main() { dbg_trace(); auto obj = GameObject(0, "name", "tag", 0); - obj.add_component(); + obj.add_component().set_script(); auto & sys = ScriptSystem::get_instance(); sys.update(); // -> MyScript::update -- cgit v1.2.3