Skip to content

Commit

Permalink
feat:[xr] support dispatch xr event to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
oahc09 committed Oct 9, 2023
1 parent d79d095 commit e0acb03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions native/cocos/platform/interfaces/modules/XRCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ enum class XRConfigKey {
ASYNC_LOAD_ASSETS_IMAGE_RESULTS = 56,
LEFT_CONTROLLER_ACTIVE = 57,
RIGHT_CONTROLLER_ACTIVE= 58,
TS_EVENT_CALLBACK = 59,
MAX_COUNT
};

Expand Down
4 changes: 4 additions & 0 deletions native/cocos/platform/java/modules/XRInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ void XRInterface::initialize(void *javaVM, void *activity) {
});
} else if (key == xr::XRConfigKey::ASYNC_LOAD_ASSETS_IMAGE && value.isInt()) {
_isFlipPixelY = value.getInt() == static_cast<int>(gfx::API::GLES3);
} else if (key == xr::XRConfigKey::TS_EVENT_CALLBACK) {
se::ValueArray args;
args.emplace_back(se::Value(value.getString()));
EventDispatcher::doDispatchJsEvent("onXREvent", args);
}
});
#if XR_OEM_PICO
Expand Down

0 comments on commit e0acb03

Please sign in to comment.