微信小程序编译
All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 13s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 17s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 35s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 15s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 33s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 5s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 15s
Plugin Library CI / publish (07.RKTools) (push) Successful in 2s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 2s
Plugin Library CI / publish (12.WeixinMinigame) (push) Successful in 2m32s

This commit is contained in:
2026-04-19 00:16:03 +08:00
parent 4c78ed674c
commit 0d6faa56f4
646 changed files with 140709 additions and 12 deletions

View File

@@ -0,0 +1,77 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { formatTouchEvent, convertOnTouchStartListenerResultToPointer } from '../utils';
let wxOnTouchCancelCallback;
let wxOnTouchEndCallback;
let wxOnTouchMoveCallback;
let wxOnTouchStartCallback;
function handleTouchEvent(res, callback) {
const dataPtr = convertOnTouchStartListenerResultToPointer({
touches: res.touches.map(v => formatTouchEvent(v, res.type)),
changedTouches: res.changedTouches.map(v => formatTouchEvent(v, res.type, 1)),
timeStamp: parseInt(res.timeStamp.toString(), 10),
});
GameGlobal.Module.dynCall_viii(callback, dataPtr, res.touches.length, res.changedTouches.length);
GameGlobal.Module._free(dataPtr);
}
const OnTouchCancel = (res) => {
handleTouchEvent(res, wxOnTouchCancelCallback);
};
const OnTouchEnd = (res) => {
handleTouchEvent(res, wxOnTouchEndCallback);
};
const OnTouchMove = (res) => {
handleTouchEvent(res, wxOnTouchMoveCallback);
};
const OnTouchStart = (res) => {
handleTouchEvent(res, wxOnTouchStartCallback);
};
function WX_OnTouchCancel() {
wx.onTouchCancel(OnTouchCancel);
}
function WX_OffTouchCancel() {
wx.offTouchCancel(OnTouchCancel);
}
function WX_OnTouchEnd() {
wx.onTouchEnd(OnTouchEnd);
}
function WX_OffTouchEnd() {
wx.offTouchEnd(OnTouchEnd);
}
function WX_OnTouchMove() {
wx.onTouchMove(OnTouchMove);
}
function WX_OffTouchMove() {
wx.offTouchMove(OnTouchMove);
}
function WX_OnTouchStart() {
wx.onTouchStart(OnTouchStart);
}
function WX_OffTouchStart() {
wx.offTouchStart(OnTouchStart);
}
function WX_RegisterOnTouchCancelCallback(callback) {
wxOnTouchCancelCallback = callback;
}
function WX_RegisterOnTouchEndCallback(callback) {
wxOnTouchEndCallback = callback;
}
function WX_RegisterOnTouchMoveCallback(callback) {
wxOnTouchMoveCallback = callback;
}
function WX_RegisterOnTouchStartCallback(callback) {
wxOnTouchStartCallback = callback;
}
export default {
WX_OnTouchCancel,
WX_OffTouchCancel,
WX_OnTouchEnd,
WX_OffTouchEnd,
WX_OnTouchMove,
WX_OffTouchMove,
WX_OnTouchStart,
WX_OffTouchStart,
WX_RegisterOnTouchCancelCallback,
WX_RegisterOnTouchEndCallback,
WX_RegisterOnTouchMoveCallback,
WX_RegisterOnTouchStartCallback,
};

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 78176ed380536ed448fdeaed13345ef1
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: