mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-26 11:48:29 +00:00
[adapters] 更改 Worker Handlers 初始化的时机;使用另一种 Audio 模块是否存在的判断方式
This commit is contained in:
parent
6c720d359d
commit
d28997bcbb
@ -3,7 +3,9 @@ if (CC_WORKER_ASSET_PIPELINE) {
|
|||||||
ipcMain.registerHandler("assetManager", assetManagerWorkerAdapter);
|
ipcMain.registerHandler("assetManager", assetManagerWorkerAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CC_WORKER_AUDIO_SYSTEM && cc._Audio) {
|
if (CC_WORKER_AUDIO_SYSTEM) {
|
||||||
const audioWorkerAdapter = require("./audio.js");
|
const audioWorkerAdapter = require("./audio.js");
|
||||||
|
if (audioWorkerAdapter.create != null) {
|
||||||
ipcMain.registerHandler("audioAdapter", audioWorkerAdapter);
|
ipcMain.registerHandler("audioAdapter", audioWorkerAdapter);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
require("./macro");
|
require("./macro");
|
||||||
require("./ipc-main.js");
|
require("./ipc-main.js");
|
||||||
require("./handlers.js");
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
init(callback) {
|
init(callback) {
|
||||||
if (CC_USE_WORKER) {
|
if (CC_USE_WORKER) {
|
||||||
var t = Date.now();
|
var t = Date.now();
|
||||||
|
require("./handlers.js");
|
||||||
ipcMain.init(() => {
|
ipcMain.init(() => {
|
||||||
console.log("worker init cost:", Date.now() - t);
|
console.log("worker init cost:", Date.now() - t);
|
||||||
console.log("worker settings:", {
|
console.log("worker settings:", {
|
||||||
|
Loading…
Reference in New Issue
Block a user