From 279d63d6c53a40ab92a0357661b837e5232a5331 Mon Sep 17 00:00:00 2001 From: O01eg Date: Sat, 28 Nov 2020 13:08:17 +0300 Subject: Run script test --- test/src/init.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'test/src/init.cpp') diff --git a/test/src/init.cpp b/test/src/init.cpp index 47d4fda..3eedb05 100644 --- a/test/src/init.cpp +++ b/test/src/init.cpp @@ -10,7 +10,10 @@ public: SimpleClass() {} /** `_init` must exist as it is called by Godot. */ - void _init() {} + void _init() { + _name = String("SimpleClass"); + _value = 0; + } void test_void_method() { Godot::print("This is test"); @@ -30,10 +33,10 @@ public: * The line below is equivalent to the following GDScript export: * export var _name = "SimpleClass" **/ - register_property("base/name", &SimpleClass::_name, String("SimpleClass")); + register_property("name", &SimpleClass::_name, String("SimpleClass")); /** Alternatively, with getter and setter methods: */ - register_property("base/value", &SimpleClass::set_value, &SimpleClass::get_value, 0); + register_property("value", &SimpleClass::set_value, &SimpleClass::get_value, 0); /** Registering a signal: **/ register_signal("signal_name0"); // windows: error C2668: 'godot::register_signal': ambiguous call to overloaded function -- cgit v1.2.3