Add signal support to Godot Android plugin:

Supports registering and emitting signal from a Godot Android plugin
This commit is contained in:
fhuya 2020-03-25 14:01:12 -07:00
parent 0826b63c7e
commit 948c3cbb88
8 changed files with 480 additions and 188 deletions

View file

@ -32,6 +32,7 @@
#include "core/engine.h"
#include "java_class_wrapper.h"
#include "jni_singleton.h"
#if !defined(ANDROID_ENABLED)
static JavaClassWrapper *java_class_wrapper = nullptr;
@ -40,7 +41,11 @@ static JavaClassWrapper *java_class_wrapper = nullptr;
void register_android_api() {
#if !defined(ANDROID_ENABLED)
// On Android platforms, the `java_class_wrapper` instantiation and the
// `JNISingleton` registration occurs in
// `platform/android/java_godot_lib_jni.cpp#Java_org_godotengine_godot_GodotLib_setup`
java_class_wrapper = memnew(JavaClassWrapper); // Dummy
ClassDB::register_class<JNISingleton>();
#endif
ClassDB::register_class<JavaClass>();