关于Godot游戏引擎开发过程的技术细节—模块开发
模块(Modules)开发
- 详细步骤
- 在Godot源代码中找到
modules/
文件夹并打开,所有自定义拓展模块都要放在这个文件夹下。 - 创建自己的模块文件夹,我这里取名为
test_modules/
,如图所示: - 打开已经创建好的文件夹,然后编写自己定义的模块的头文件和cpp文件(注意:godot模块使用的是C++),在这里,我创建了一个叫做
test_debugger
的类作为临时测试,这个类很简单,主要是测试自定义函数add_a_b()
是否能正常使用。
test_debugger.h
#ifndef TEST_DEBUGGER_H #define TEST_DEBUGGER_H #include "core/reference.h" #include <string> class test_debugger:public Reference { private: String debugger_text; int16_t test_num; int16_t a;
- 在Godot源代码中找到