mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-10-25 19:25:22 +00:00
[extension] 增加对自定义多线程扩展的支持,并更新 meta 文件
This commit is contained in:
3
extension/templates/2.4.13/2.1.0/worker/src/index.js
Normal file
3
extension/templates/2.4.13/2.1.0/worker/src/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
// 该文件会在 Worker 初始化时执行,可在这里初始化或者引用其它脚本
|
||||
// This file will be executed when the Worker is initialized, either initialize it here or require another script.
|
||||
require("math.js");
|
||||
9
extension/templates/2.4.13/2.1.0/worker/src/math.js
Normal file
9
extension/templates/2.4.13/2.1.0/worker/src/math.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const { registerHandler } = require("ipc-worker.js");
|
||||
|
||||
export function add(x, y, callback) {
|
||||
callback(x + y);
|
||||
}
|
||||
|
||||
registerHandler("math", {
|
||||
add,
|
||||
});
|
||||
Reference in New Issue
Block a user