index.html 26 KB

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