微信小程序编译
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
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:
@@ -0,0 +1,80 @@
|
||||
|
||||
import moduleHelper from './module-helper';
|
||||
import canvasHelper from './canvas';
|
||||
import fs from './fs';
|
||||
import util from './util';
|
||||
import audio from './audio/index';
|
||||
import texture from './texture';
|
||||
import fix from './fix';
|
||||
import canvasContext from './canvas-context';
|
||||
import video from './video';
|
||||
import logger from './logger';
|
||||
import sdk from './sdk';
|
||||
import videoDecoder from './video/index';
|
||||
import mobileKeyboard from './mobileKeyboard/index';
|
||||
import touch from './touch/index';
|
||||
import specialCallbacks from './special-callbacks';
|
||||
const unityVersion = '$unityVersion$';
|
||||
GameGlobal.unityNamespace = GameGlobal.unityNamespace || {};
|
||||
GameGlobal.unityNamespace.unityVersion = unityVersion;
|
||||
window._ScaleRate = 1;
|
||||
|
||||
if (unityVersion && unityVersion.split('.').slice(0, 2)
|
||||
.join('') < '20193') {
|
||||
const width = window.innerWidth * window.devicePixelRatio;
|
||||
const height = window.innerHeight * window.devicePixelRatio;
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
window._ScaleRate = window.devicePixelRatio;
|
||||
}
|
||||
Object.defineProperty(canvas, 'clientHeight', {
|
||||
get() {
|
||||
return window.innerHeight * window._ScaleRate;
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(canvas, 'clientWidth', {
|
||||
get() {
|
||||
return window.innerWidth * window._ScaleRate;
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(document.body, 'clientHeight', {
|
||||
get() {
|
||||
return window.innerHeight * window._ScaleRate;
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(document.body, 'clientWidth', {
|
||||
get() {
|
||||
return window.innerWidth * window._ScaleRate;
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(document, 'fullscreenEnabled', {
|
||||
get() {
|
||||
return true;
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
fix.init();
|
||||
const WXWASMSDK = {
|
||||
WXInitializeSDK() {
|
||||
moduleHelper.init();
|
||||
moduleHelper.send('Inited', 200);
|
||||
},
|
||||
...canvasHelper,
|
||||
...fs,
|
||||
...util,
|
||||
...audio,
|
||||
...texture,
|
||||
...video,
|
||||
...logger,
|
||||
canvasContext,
|
||||
...sdk,
|
||||
...videoDecoder,
|
||||
...mobileKeyboard,
|
||||
...touch,
|
||||
...specialCallbacks,
|
||||
};
|
||||
GameGlobal.WXWASMSDK = WXWASMSDK;
|
||||
Reference in New Issue
Block a user