index.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  1. <!DOCTYPE html>
  2. <html lang="en-us">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <title>Tuanjie WebGL Player | XY001</title>
  7. <link rel="shortcut icon" href="TemplateData/favicon.ico">
  8. <link rel="stylesheet" href="TemplateData/style.css">
  9. </head>
  10. <body>
  11. <div id="tuanjie-container" class="tuanjie-desktop">
  12. <canvas id="tuanjie-canvas" width=960 height=600 tabindex="-1"></canvas>
  13. <div id="tuanjie-loading-bar">
  14. <div id="tuanjie-logo"></div>
  15. <div id="tuanjie-progress-bar-empty">
  16. <div id="tuanjie-progress-bar-full"></div>
  17. </div>
  18. </div>
  19. <div id="tuanjie-warning"> </div>
  20. <div id="tuanjie-footer">
  21. <div id="tuanjie-webgl-logo"></div>
  22. <div id="tuanjie-fullscreen-button"></div>
  23. <div id="tuanjie-build-title">XY001</div>
  24. </div>
  25. </div>
  26. <script>
  27. var gameInstance;
  28. var container = document.querySelector("#tuanjie-container");
  29. var canvas = document.querySelector("#tuanjie-canvas");
  30. var loadingBar = document.querySelector("#tuanjie-loading-bar");
  31. var progressBarFull = document.querySelector("#tuanjie-progress-bar-full");
  32. var fullscreenButton = document.querySelector("#tuanjie-fullscreen-button");
  33. var warningBanner = document.querySelector("#tuanjie-warning");
  34. // Shows a temporary message banner/ribbon for a few seconds, or
  35. // a permanent error message on top of the canvas if type=='error'.
  36. // If type=='warning', a yellow highlight color is used.
  37. // Modify or remove this function to customize the visually presented
  38. // way that non-critical warnings and error messages are presented to the
  39. // user.
  40. function unityShowBanner(msg, type) {
  41. function updateBannerVisibility() {
  42. warningBanner.style.display = warningBanner.children.length ? 'block' : 'none';
  43. }
  44. var div = document.createElement('div');
  45. div.innerHTML = msg;
  46. warningBanner.appendChild(div);
  47. if (type == 'error') div.style = 'background: red; padding: 10px;';
  48. else {
  49. if (type == 'warning') div.style = 'background: yellow; padding: 10px;';
  50. setTimeout(function() {
  51. warningBanner.removeChild(div);
  52. updateBannerVisibility();
  53. }, 5000);
  54. }
  55. updateBannerVisibility();
  56. }
  57. var buildUrl = "Build";
  58. var loaderUrl = buildUrl + "/webgl.loader.js";
  59. var config = {
  60. dataUrl: buildUrl + "/WeixinMiniGame.data",
  61. frameworkUrl: buildUrl + "/WeixinMiniGame.framework.js",
  62. codeUrl: buildUrl + "/WeixinMiniGame.wasm",
  63. symbolsUrl: buildUrl + "/WeixinMiniGame.symbols.json",
  64. streamingAssetsUrl: "StreamingAssets",
  65. companyName: "DefaultCompany",
  66. productName: "XY001",
  67. productVersion: "1.0",
  68. showBanner: unityShowBanner,
  69. };
  70. // By default Tuanjie keeps WebGL canvas render target size matched with
  71. // the DOM size of the canvas element (scaled by window.devicePixelRatio)
  72. // Set this to false if you want to decouple this synchronization from
  73. // happening inside the engine, and you would instead like to size up
  74. // the canvas DOM size and WebGL render target sizes yourself.
  75. // config.matchWebGLToCanvasSize = false;
  76. if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
  77. // Mobile device style: fill the whole browser client area with the game canvas:
  78. var meta = document.createElement('meta');
  79. meta.name = 'viewport';
  80. meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
  81. document.getElementsByTagName('head')[0].appendChild(meta);
  82. container.className = "tuanjie-mobile";
  83. canvas.className = "tuanjie-mobile";
  84. // To lower canvas resolution on mobile devices to gain some
  85. // performance, uncomment the following line:
  86. // config.devicePixelRatio = 1;
  87. } else {
  88. // Desktop style: Render the game canvas in a window that can be maximized to fullscreen:
  89. canvas.style.width = "960px";
  90. canvas.style.height = "600px";
  91. }
  92. loadingBar.style.display = "block";
  93. var script = document.createElement("script");
  94. script.src = loaderUrl;
  95. script.onload = () => {
  96. createTuanjieInstance(canvas, config, (progress) => {
  97. progressBarFull.style.width = 100 * progress + "%";
  98. }).then((tuanjieInstance) => {
  99. loadingBar.style.display = "none";
  100. fullscreenButton.onclick = () => {
  101. tuanjieInstance.SetFullscreen(1);
  102. };
  103. gameInstance = tuanjieInstance;
  104. }).catch((message) => {
  105. alert(message);
  106. });
  107. };
  108. document.body.appendChild(script);
  109. </script>
  110. <script>
  111. var storage = {};
  112. function getStorageValue(key, defaultValue) {
  113. var v = storage[key];
  114. if (v === null) {
  115. return defaultValue;
  116. }
  117. if (typeof v !== 'undefined') {
  118. return v;
  119. }
  120. return defaultValue;
  121. }
  122. var WXWASMSDK = {
  123. WXInitializeSDK() {
  124. gameInstance.SendMessage('WXSDKManagerHandler', 'Inited', 200);
  125. },
  126. WXStorageSetIntSync(key, value) {
  127. storage[key] = value;
  128. },
  129. WXStorageGetIntSync(key, defaultValue) {
  130. return getStorageValue(key, defaultValue);
  131. },
  132. WXStorageSetFloatSync(key, value) {
  133. storage[key] = value;
  134. },
  135. WXStorageGetFloatSync(key, defaultValue) {
  136. return getStorageValue(key, defaultValue);
  137. },
  138. WXStorageSetStringSync(key, value) {
  139. storage[key] = value;
  140. },
  141. WXStorageGetStringSync(key, defaultValue) {
  142. return getStorageValue(key, defaultValue || '');
  143. },
  144. WXStorageDeleteAllSync() {
  145. storage = {};
  146. },
  147. WXStorageDeleteKeySync(key) {
  148. delete storage[key];
  149. },
  150. WXStorageHasKeySync(key) {
  151. return typeof storage[key] === 'undefined';
  152. },
  153. WXCheckSession(s, f, c) {},
  154. WXAuthorize(scope, s, f, c) {},
  155. WXCreateUserInfoButton(x, y, width, height, lang, withCredentials) {
  156. return "";
  157. },
  158. WXUserInfoButtonShow(id) {},
  159. WXUserInfoButtonDestroy(id) {},
  160. WXUserInfoButtonHide(id) {},
  161. WXUserInfoButtonOffTap(id) {},
  162. WXUserInfoButtonOnTap(id) {},
  163. WXOnShareAppMessage(conf, isPromise) {},
  164. WXOnShareAppMessageResolve(conf) {},
  165. WXOffShareAppMessage() {},
  166. WXCreateBannerAd(conf) {
  167. return Math.random().toString(32);
  168. },
  169. WXCreateRewardedVideoAd(conf) {
  170. return Math.random().toString(32);
  171. },
  172. WXCreateInterstitialAd(conf) {
  173. return Math.random().toString(32);
  174. },
  175. WXCreateCustomAd(conf) {},
  176. WXADStyleChange(id, key, value) {},
  177. WXShowAd(id) {},
  178. WXHideAd(id) {},
  179. WXADGetStyleValue(id, key) {},
  180. WXADDestroy(id) {},
  181. WXADLoad(id, succ, fail) {},
  182. WXToTempFilePathSync(conf) {},
  183. WXGetUserDataPath() {},
  184. WXWriteFileSync(filePath, data, encoding) {},
  185. WXCreateFixedBottomMiddleBannerAd(adUnitId, adIntervals, height) {
  186. return Math.random().toString(32);
  187. },
  188. WXReportGameStart() {},
  189. WXReportGameSceneError(sceneId, errorType, errStr, extJsonStr) {},
  190. WXWriteLog(str) {},
  191. WXWriteWarn(str) {},
  192. WXHideLoadingPage() {},
  193. WXPreloadConcurrent() {},
  194. WXCreateInnerAudioContext() {
  195. return Math.random().toString(32);
  196. },
  197. WXInnerAudioContextSetBool() {},
  198. WXInnerAudioContextSetString() {},
  199. WXInnerAudioContextSetFloat() {},
  200. WXInnerAudioContextGetFloat() {},
  201. WXInnerAudioContextGetBool() {},
  202. WXInnerAudioContextPlay() {},
  203. WXInnerAudioContextPause() {},
  204. WXInnerAudioContextStop() {},
  205. WXInnerAudioContextDestroy() {},
  206. WXInnerAudioContextSeek() {},
  207. WXInnerAudioContextAddListener(id, key) {
  208. if (key === 'onCanplay') {
  209. setTimeout(function () {
  210. gameInstance.SendMessage(
  211. 'WXSDKManagerHandler',
  212. 'OnAudioCallback',
  213. JSON.stringify({
  214. callbackId: id,
  215. errMsg: key,
  216. })
  217. );
  218. }, 100);
  219. }
  220. },
  221. WXInnerAudioContextRemoveListener() {},
  222. WXPreDownloadAudios(paths, id) {
  223. gameInstance.SendMessage(
  224. 'WXSDKManagerHandler',
  225. 'WXPreDownloadAudiosCallback',
  226. JSON.stringify({
  227. callbackId: id.toString(),
  228. errMsg: '0',
  229. })
  230. );
  231. },
  232. WXCreateVideo() {
  233. return Math.random().toString(32);
  234. },
  235. WXVideoPlay() {},
  236. WXVideoAddListener() {},
  237. WXVideoDestroy() {},
  238. WXVideoExitFullScreen() {},
  239. WXVideoPause() {},
  240. WXVideoRequestFullScreen() {},
  241. WXVideoSeek() {},
  242. WXVideoStop() {},
  243. WXVideoRemoveListener() {},
  244. WXShowOpenData() {},
  245. WXDownloadTexture(id, type, callback) {
  246. var Infos = {
  247. Texture: GameGlobal.TextureConfig,
  248. SpriteAtlas: GameGlobal.SpriteAtlasConfig,
  249. }[type];
  250. if (!Infos[id]) {
  251. return console.error(type + '映射id 不存在', id);
  252. }
  253. var path = Infos[id].p;
  254. var cid = type + '_' + id;
  255. if (downloadedTextures[cid]) {
  256. if (downloadedTextures[cid].data) {
  257. callback();
  258. } else {
  259. console.error(type + '映射id data 不存在!', id);
  260. }
  261. } else if (downloadingTextures[cid]) {
  262. downloadingTextures[cid].push(callback);
  263. } else {
  264. downloadingTextures[cid] = [callback];
  265. textureHandler.downloadFile(
  266. id,
  267. type,
  268. GameGlobal.AUDIO_PREFIX.replace(/\/$/, '') + '/' + path.replace(/\\/g, '/')
  269. );
  270. }
  271. },
  272. WXCreateGameClubButton() {
  273. return Math.random().toString(32);
  274. },
  275. WXGameClubButtonDestroy() {},
  276. WXGameClubButtonHide() {},
  277. WXGameClubButtonShow() {},
  278. WXGameClubButtonAddListener() {},
  279. WXGameClubButtonRemoveListener() {},
  280. WXGameClubButtonSetProperty() {},
  281. WXGameClubStyleChangeInt() {},
  282. WXGameClubStyleChangeStr() {},
  283. WXIsCloudTest() {
  284. return false;
  285. },
  286. WXUncaughtException() {},
  287. WXSetDataCDN() {},
  288. WXSetPreloadList() {},
  289. WXGetCachePath() {},
  290. WXGetPluginCachePath() {},
  291. WXGetFontRawData() {},
  292. WXShareFontBuffer() {},
  293. WXReportShareBehavior() {},
  294. WXShowAd2() {},
  295. WXToTempFilePath() {},
  296. WXDataContextPostMessage() {},
  297. WXHideOpenData() {},
  298. WXAccessFileSync() {},
  299. WXAccessFile() {},
  300. WXCopyFileSync() {},
  301. WXCopyFile() {},
  302. WXUnlinkSync() {},
  303. WXUnlink() {},
  304. WXReportUserBehaviorBranchAnalytics() {},
  305. WXCallFunction() {},
  306. WXCallFunctionInit() {},
  307. WXCloudID() {},
  308. WXWriteFile() {},
  309. WXWriteStringFile() {},
  310. WXAppendFile() {},
  311. WXAppendStringFile() {},
  312. WXWriteBinFileSync() {},
  313. WXReadFile() {},
  314. WXReadFileSync() {},
  315. WXShareFileBuffer() {},
  316. WXLogManagerDebug() {},
  317. WXLogManagerInfo() {},
  318. WXLogManagerLog() {},
  319. WXLogManagerWarn() {},
  320. WXCleanAllFileCache() {},
  321. WXCleanFileCache() {},
  322. WXRemoveFile() {},
  323. WXOnLaunchProgress() {},
  324. WXMkdir() {},
  325. WXMkdirSync() {},
  326. WXRmdir() {},
  327. WXRmdirSync() {},
  328. WXCameraCreateCamera() {},
  329. WXCameraCloseFrameChange() {},
  330. WXCameraDestroy() {},
  331. WXCameraListenFrameChange() {},
  332. WXCameraOnAuthCancel() {},
  333. WXCameraOnCameraFrame() {},
  334. WXCameraOnStop() {},
  335. WX_GetRecorderManager() {},
  336. WX_OnRecorderError() {},
  337. WX_OnRecorderFrameRecorded() {},
  338. WX_OnRecorderInterruptionBegin() {},
  339. WX_OnRecorderInterruptionEnd() {},
  340. WX_OnRecorderPause() {},
  341. WX_OnRecorderResume() {},
  342. WX_OnRecorderStart() {},
  343. WX_OnRecorderStop() {},
  344. WX_RecorderPause() {},
  345. WX_RecorderResume() {},
  346. WX_RecorderStart() {},
  347. WX_RecorderStop() {},
  348. WX_UploadFile() {},
  349. WXUploadTaskAbort() {},
  350. WXUploadTaskOffHeadersReceived() {},
  351. WXUploadTaskOffProgressUpdate() {},
  352. WXUploadTaskOnHeadersReceived() {},
  353. WXUploadTaskOnProgressUpdate() {},
  354. WXStat() {},
  355. WX_GetGameRecorder() {},
  356. WX_GameRecorderOff() {},
  357. WX_GameRecorderOn() {},
  358. WX_GameRecorderStart() {},
  359. WX_GameRecorderAbort() {},
  360. WX_GameRecorderPause() {},
  361. WX_GameRecorderResume() {},
  362. WX_GameRecorderStop() {},
  363. WX_OperateGameRecorderVideo() {},
  364. WXChatCreate() {},
  365. WXChatHide() {},
  366. WXChatShow() {},
  367. WXChatClose() {},
  368. WXChatOpen() {},
  369. WXChatSetTabs() {},
  370. WXChatOn() {},
  371. WXChatOff() {},
  372. WXChatSetSignature() {},
  373. WXSetArrayBuffer() {},
  374. WX_AddCard(conf, callbackId){},
  375. WX_AuthPrivateMessage(conf, callbackId){},
  376. WX_Authorize(conf, callbackId){},
  377. WX_CheckIsAddedToMyMiniProgram(conf, callbackId){},
  378. WX_CheckSession(conf, callbackId){},
  379. WX_ChooseImage(conf, callbackId){},
  380. WX_ChooseMedia(conf, callbackId){},
  381. WX_ChooseMessageFile(conf, callbackId){},
  382. WX_CloseBLEConnection(conf, callbackId){},
  383. WX_CloseBluetoothAdapter(conf, callbackId){},
  384. WX_CloseSocket(conf, callbackId){},
  385. WX_CreateBLEConnection(conf, callbackId){},
  386. WX_CreateBLEPeripheralServer(conf, callbackId){},
  387. WX_ExitMiniProgram(conf, callbackId){},
  388. WX_ExitVoIPChat(conf, callbackId){},
  389. WX_FaceDetect(conf, callbackId){},
  390. WX_GetAvailableAudioSources(conf, callbackId){},
  391. WX_GetBLEDeviceCharacteristics(conf, callbackId){},
  392. WX_GetBLEDeviceRSSI(conf, callbackId){},
  393. WX_GetBLEDeviceServices(conf, callbackId){},
  394. WX_GetBLEMTU(conf, callbackId){},
  395. WX_GetBatteryInfo(conf, callbackId){},
  396. WX_GetBeacons(conf, callbackId){},
  397. WX_GetBluetoothAdapterState(conf, callbackId){},
  398. WX_GetBluetoothDevices(conf, callbackId){},
  399. WX_GetChannelsLiveInfo(conf, callbackId){},
  400. WX_GetChannelsLiveNoticeInfo(conf, callbackId){},
  401. WX_GetClipboardData(conf, callbackId){},
  402. WX_GetConnectedBluetoothDevices(conf, callbackId){},
  403. WX_GetExtConfig(conf, callbackId){},
  404. WX_GetFuzzyLocation(conf, callbackId){},
  405. WX_GetGameClubData(conf, callbackId){},
  406. WX_GetGroupEnterInfo(conf, callbackId){},
  407. WX_GetInferenceEnvInfo(conf, callbackId){},
  408. WX_GetLocalIPAddress(conf, callbackId){},
  409. WX_GetLocation(conf, callbackId){},
  410. WX_GetNetworkType(conf, callbackId){},
  411. WX_GetScreenBrightness(conf, callbackId){},
  412. WX_GetSetting(conf, callbackId){},
  413. WX_GetShareInfo(conf, callbackId){},
  414. WX_GetStorageInfo(conf, callbackId){},
  415. WX_GetSystemInfo(conf, callbackId){},
  416. WX_GetSystemInfoAsync(conf, callbackId){},
  417. WX_GetUserInfo(conf, callbackId){},
  418. WX_GetUserInteractiveStorage(conf, callbackId){},
  419. WX_GetWeRunData(conf, callbackId){},
  420. WX_HideKeyboard(conf, callbackId){},
  421. WX_HideLoading(conf, callbackId){},
  422. WX_HideShareMenu(conf, callbackId){},
  423. WX_HideToast(conf, callbackId){},
  424. WX_InitFaceDetect(conf, callbackId){},
  425. WX_IsBluetoothDevicePaired(conf, callbackId){},
  426. WX_JoinVoIPChat(conf, callbackId){},
  427. WX_Login(conf, callbackId){},
  428. WX_MakeBluetoothPair(conf, callbackId){},
  429. WX_NavigateToMiniProgram(conf, callbackId){},
  430. WX_NotifyBLECharacteristicValueChange(conf, callbackId){},
  431. WX_OpenAppAuthorizeSetting(conf, callbackId){},
  432. WX_OpenBluetoothAdapter(conf, callbackId){},
  433. WX_OpenCard(conf, callbackId){},
  434. WX_OpenChannelsActivity(conf, callbackId){},
  435. WX_OpenChannelsEvent(conf, callbackId){},
  436. WX_OpenChannelsLive(conf, callbackId){},
  437. WX_OpenChannelsUserProfile(conf, callbackId){},
  438. WX_OpenCustomerServiceChat(conf, callbackId){},
  439. WX_OpenCustomerServiceConversation(conf, callbackId){},
  440. WX_OpenSetting(conf, callbackId){},
  441. WX_OpenSystemBluetoothSetting(conf, callbackId){},
  442. WX_PreviewImage(conf, callbackId){},
  443. WX_PreviewMedia(conf, callbackId){},
  444. WX_ReadBLECharacteristicValue(conf, callbackId){},
  445. WX_RemoveStorage(conf, callbackId){},
  446. WX_RemoveUserCloudStorage(conf, callbackId){},
  447. WX_ReportScene(conf, callbackId){},
  448. WX_RequestMidasFriendPayment(conf, callbackId){},
  449. WX_RequestMidasPayment(conf, callbackId){},
  450. WX_RequestSubscribeMessage(conf, callbackId){},
  451. WX_RequestSubscribeSystemMessage(conf, callbackId){},
  452. WX_RestartMiniProgram(conf, callbackId){},
  453. WX_SaveFileToDisk(conf, callbackId){},
  454. WX_SaveImageToPhotosAlbum(conf, callbackId){},
  455. WX_ScanCode(conf, callbackId){},
  456. WX_SendSocketMessage(conf, callbackId){},
  457. WX_SetBLEMTU(conf, callbackId){},
  458. WX_SetClipboardData(conf, callbackId){},
  459. WX_SetDeviceOrientation(conf, callbackId){},
  460. WX_SetEnableDebug(conf, callbackId){},
  461. WX_SetInnerAudioOption(conf, callbackId){},
  462. WX_SetKeepScreenOn(conf, callbackId){},
  463. WX_SetMenuStyle(conf, callbackId){},
  464. WX_SetScreenBrightness(conf, callbackId){},
  465. WX_SetStatusBarStyle(conf, callbackId){},
  466. WX_SetUserCloudStorage(conf, callbackId){},
  467. WX_ShowActionSheet(conf, callbackId){},
  468. WX_ShowKeyboard(conf, callbackId){},
  469. WX_ShowLoading(conf, callbackId){},
  470. WX_ShowModal(conf, callbackId){},
  471. WX_ShowShareImageMenu(conf, callbackId){},
  472. WX_ShowShareMenu(conf, callbackId){},
  473. WX_ShowToast(conf, callbackId){},
  474. WX_StartAccelerometer(conf, callbackId){},
  475. WX_StartBeaconDiscovery(conf, callbackId){},
  476. WX_StartBluetoothDevicesDiscovery(conf, callbackId){},
  477. WX_StartCompass(conf, callbackId){},
  478. WX_StartDeviceMotionListening(conf, callbackId){},
  479. WX_StartGyroscope(conf, callbackId){},
  480. WX_StopAccelerometer(conf, callbackId){},
  481. WX_StopBeaconDiscovery(conf, callbackId){},
  482. WX_StopBluetoothDevicesDiscovery(conf, callbackId){},
  483. WX_StopCompass(conf, callbackId){},
  484. WX_StopDeviceMotionListening(conf, callbackId){},
  485. WX_StopFaceDetect(conf, callbackId){},
  486. WX_StopGyroscope(conf, callbackId){},
  487. WX_UpdateKeyboard(conf, callbackId){},
  488. WX_UpdateShareMenu(conf, callbackId){},
  489. WX_UpdateVoIPChatMuteConfig(conf, callbackId){},
  490. WX_UpdateWeChatApp(conf, callbackId){},
  491. WX_VibrateLong(conf, callbackId){},
  492. WX_VibrateShort(conf, callbackId){},
  493. WX_WriteBLECharacteristicValue(conf, callbackId){},
  494. WX_StartGameLive(conf, callbackId){},
  495. WX_CheckGameLiveEnabled(conf, callbackId){},
  496. WX_GetUserCurrentGameliveInfo(conf, callbackId){},
  497. WX_GetUserRecentGameLiveInfo(conf, callbackId){},
  498. WX_GetUserGameLiveDetails(conf, callbackId){},
  499. WX_OpenChannelsLiveCollection(conf, callbackId){},
  500. WX_OpenPage(conf, callbackId){},
  501. WX_RequestMidasPaymentGameItem(conf, callbackId){},
  502. WX_OperateGameRecorderVideo() {},
  503. WX_RemoveStorageSync() {},
  504. WX_ReportEvent() {},
  505. WX_ReportMonitor() {},
  506. WX_ReportPerformance() {},
  507. WX_ReportUserBehaviorBranchAnalytics() {},
  508. WX_ReserveChannelsLive() {},
  509. WX_RevokeBufferURL() {},
  510. WX_SetPreferredFramesPerSecond() {},
  511. WX_SetStorageSync() {},
  512. WX_ShareAppMessage() {},
  513. WX_TriggerGC() {},
  514. WX_OnAccelerometerChange() {},
  515. WX_OffAccelerometerChange() {},
  516. WX_OnAudioInterruptionBegin() {},
  517. WX_OffAudioInterruptionBegin() {},
  518. WX_OnAudioInterruptionEnd() {},
  519. WX_OffAudioInterruptionEnd() {},
  520. WX_OnBLECharacteristicValueChange() {},
  521. WX_OffBLECharacteristicValueChange() {},
  522. WX_OnBLEConnectionStateChange() {},
  523. WX_OffBLEConnectionStateChange() {},
  524. WX_OnBLEMTUChange() {},
  525. WX_OffBLEMTUChange() {},
  526. WX_OnBLEPeripheralConnectionStateChanged() {},
  527. WX_OffBLEPeripheralConnectionStateChanged() {},
  528. WX_OnBeaconServiceChange() {},
  529. WX_OffBeaconServiceChange() {},
  530. WX_OnBeaconUpdate() {},
  531. WX_OffBeaconUpdate() {},
  532. WX_OnBluetoothAdapterStateChange() {},
  533. WX_OffBluetoothAdapterStateChange() {},
  534. WX_OnBluetoothDeviceFound() {},
  535. WX_OffBluetoothDeviceFound() {},
  536. WX_OnCompassChange() {},
  537. WX_OffCompassChange() {},
  538. WX_OnDeviceMotionChange() {},
  539. WX_OffDeviceMotionChange() {},
  540. WX_OnDeviceOrientationChange() {},
  541. WX_OffDeviceOrientationChange() {},
  542. WX_OnError() {},
  543. WX_OffError() {},
  544. WX_OnGyroscopeChange() {},
  545. WX_OffGyroscopeChange() {},
  546. WX_OnHide() {},
  547. WX_OffHide() {},
  548. WX_OnInteractiveStorageModified() {},
  549. WX_OffInteractiveStorageModified() {},
  550. WX_OnKeyDown() {},
  551. WX_OffKeyDown() {},
  552. WX_OnKeyUp() {},
  553. WX_OffKeyUp() {},
  554. WX_OnKeyboardComplete() {},
  555. WX_OffKeyboardComplete() {},
  556. WX_OnKeyboardConfirm() {},
  557. WX_OffKeyboardConfirm() {},
  558. WX_OnKeyboardHeightChange() {},
  559. WX_OffKeyboardHeightChange() {},
  560. WX_OnKeyboardInput() {},
  561. WX_OffKeyboardInput() {},
  562. WX_OnMemoryWarning() {},
  563. WX_OffMemoryWarning() {},
  564. WX_OnMessage() {},
  565. WX_OnNetworkStatusChange() {},
  566. WX_OffNetworkStatusChange() {},
  567. WX_OnNetworkWeakChange() {},
  568. WX_OffNetworkWeakChange() {},
  569. WX_OnShareMessageToFriend() {},
  570. WX_OnShow() {},
  571. WX_OffShow() {},
  572. WX_OnSocketClose() {},
  573. WX_OnSocketError() {},
  574. WX_OnSocketMessage() {},
  575. WX_OnSocketOpen() {},
  576. WX_OnTouchCancel() {},
  577. WX_OffTouchCancel() {},
  578. WX_OnTouchEnd() {},
  579. WX_OffTouchEnd() {},
  580. WX_OnTouchMove() {},
  581. WX_OffTouchMove() {},
  582. WX_OnTouchStart() {},
  583. WX_OffTouchStart() {},
  584. WX_OnUnhandledRejection() {},
  585. WX_OffUnhandledRejection() {},
  586. WX_OnUserCaptureScreen() {},
  587. WX_OffUserCaptureScreen() {},
  588. WX_OnVoIPChatInterrupted() {},
  589. WX_OffVoIPChatInterrupted() {},
  590. WX_OnVoIPChatMembersChanged() {},
  591. WX_OffVoIPChatMembersChanged() {},
  592. WX_OnVoIPChatSpeakersChanged() {},
  593. WX_OffVoIPChatSpeakersChanged() {},
  594. WX_OnVoIPChatStateChanged() {},
  595. WX_OffVoIPChatStateChanged() {},
  596. WX_OnWheel() {},
  597. WX_OffWheel() {},
  598. WX_OnWindowResize() {},
  599. WX_OffWindowResize() {},
  600. WX_OnAddToFavorites() {},
  601. WX_OnAddToFavorites_Resolve(conf){},
  602. WX_OffAddToFavorites() {},
  603. WX_OnCopyUrl() {},
  604. WX_OnCopyUrl_Resolve(conf){},
  605. WX_OffCopyUrl() {},
  606. WX_OnHandoff() {},
  607. WX_OnHandoff_Resolve(conf){},
  608. WX_OffHandoff() {},
  609. WX_OnShareTimeline() {},
  610. WX_OnShareTimeline_Resolve(conf){},
  611. WX_OffShareTimeline() {},
  612. WX_OnGameLiveStateChange() {},
  613. WX_OnGameLiveStateChange_Resolve(conf){},
  614. WX_OffGameLiveStateChange() {},
  615. WX_SetHandoffQuery(query){
  616. return "";
  617. },
  618. WX_GetAccountInfoSync(){
  619. return JSON.stringify({});
  620. },
  621. WX_GetAppAuthorizeSetting(){
  622. return JSON.stringify({});
  623. },
  624. WX_GetAppBaseInfo(){
  625. return JSON.stringify({});
  626. },
  627. WX_GetBatteryInfoSync(){
  628. return JSON.stringify({});
  629. },
  630. WX_GetDeviceInfo(){
  631. return JSON.stringify({});
  632. },
  633. WX_GetEnterOptionsSync(){
  634. return JSON.stringify({});
  635. },
  636. WX_GetExptInfoSync(keys){
  637. return JSON.stringify({});
  638. },
  639. WX_GetExtConfigSync(){
  640. return JSON.stringify({});
  641. },
  642. WX_GetLaunchOptionsSync(){
  643. return JSON.stringify({});
  644. },
  645. WX_GetMenuButtonBoundingClientRect(){
  646. return JSON.stringify({});
  647. },
  648. WX_GetStorageInfoSync(){
  649. return JSON.stringify({});
  650. },
  651. WX_GetSystemInfoSync(){
  652. return JSON.stringify({});
  653. },
  654. WX_GetSystemSetting(){
  655. return JSON.stringify({});
  656. },
  657. WX_GetWindowInfo(){
  658. return JSON.stringify({});
  659. },
  660. WX_CreateImageData(){
  661. return JSON.stringify({});
  662. },
  663. WX_CreatePath2D(){
  664. return JSON.stringify({});
  665. },
  666. WX_SetCursor(path, x, y){
  667. return "";
  668. },
  669. WX_SetMessageToFriendQuery(option){
  670. return "";
  671. },
  672. WX_GetTextLineHeight(option){
  673. return "";
  674. },
  675. WX_LoadFont(path){
  676. return "";
  677. },
  678. WX_GetGameLiveState(){
  679. return JSON.stringify({});
  680. },
  681. WX_CreateFeedbackButton() {return ""},
  682. WX_GetLogManager() {return ""},
  683. WX_GetRealtimeLogManager() {return ""},
  684. WX_GetUpdateManager() {return ""},
  685. WX_CreateVideoDecoder() {return ""},
  686. WXFeedbackButtonSetProperty() {},
  687. WX_FeedbackButtonDestroy() {},
  688. WX_FeedbackButtonHide() {},
  689. WX_FeedbackButtonOffTap() {},
  690. WX_FeedbackButtonOnTap() {},
  691. WX_FeedbackButtonShow() {},
  692. WX_LogManagerDebug() {},
  693. WX_LogManagerInfo() {},
  694. WX_LogManagerLog() {},
  695. WX_LogManagerWarn() {},
  696. WX_RealtimeLogManagerAddFilterMsg() {},
  697. WX_RealtimeLogManagerError() {},
  698. WX_RealtimeLogManagerInfo() {},
  699. WX_RealtimeLogManagerSetFilterMsg() {},
  700. WX_RealtimeLogManagerWarn() {},
  701. WX_UpdateManagerApplyUpdate() {},
  702. WX_UpdateManagerOnCheckForUpdate() {},
  703. WX_UpdateManagerOnUpdateFailed() {},
  704. WX_UpdateManagerOnUpdateReady() {},
  705. WX_VideoDecoderGetFrameData() {},
  706. WX_VideoDecoderRemove() {},
  707. WX_VideoDecoderSeek() {},
  708. WX_VideoDecoderStart() {},
  709. WX_VideoDecoderStop() {},
  710. WX_VideoDecoderOff() {},
  711. WX_VideoDecoderOn() {},
  712. };
  713. var downloadedTextures = {};
  714. var downloadingTextures = {};
  715. var textureHandler = {
  716. downloadFile(textureId, type, prefix) {
  717. var url = prefix + '.png';
  718. var cid = type + '_' + textureId;
  719. var image = new Image();
  720. image.src = url;
  721. image.onload = function () {
  722. downloadedTextures[cid] = {
  723. data: image,
  724. };
  725. if (downloadingTextures[cid] instanceof Array) {
  726. downloadingTextures[cid].forEach(v => v());
  727. } else {
  728. downloadingTextures[cid]();
  729. }
  730. delete downloadingTextures[cid];
  731. };
  732. image.onerror = function () {
  733. console.error(url + ' 下载失败!');
  734. };
  735. },
  736. };
  737. var GameGlobal = {
  738. TextureConfig: {},
  739. SpriteAtlasConfig: {},
  740. DownloadedTextures: downloadedTextures,
  741. AUDIO_PREFIX: './Assets/Textures/',
  742. };
  743. window._ScaleRate = 1;
  744. </script>
  745. </body>
  746. </html>