lsc 3 anni fa
parent
commit
60aa8b71bd

+ 3 - 0
Assets/WebGLTemplates/template/index.html

@@ -33,6 +33,9 @@
       // devicePixelRatio: 1, // Uncomment this to override low DPI rendering on high DPI displays.
     }, (progress) => {}).then((unityInstance) => {
       myGameInstance = unityInstance;
+      window.parent.postMessage({
+        success: 1
+      }, '*');
     });
     window.onload = function () {
       Reset();

BIN
Library/ArtifactDB


BIN
Library/SourceAssetDB


+ 4 - 1
dist/index.html

@@ -33,6 +33,9 @@
       // devicePixelRatio: 1, // Uncomment this to override low DPI rendering on high DPI displays.
     }, (progress) => {}).then((unityInstance) => {
       myGameInstance = unityInstance;
+      window.parent.postMessage({
+        success: 1
+      }, '*');
     });
     window.onload = function () {
       Reset();
@@ -52,7 +55,7 @@
     }
 
     window.addEventListener('message', function (e) { // 监听 message 事件
-      if(e.data.type){
+      if (e.data.type) {
         send(e.data.type);
       }
     });