unity-webgl

Wasm code generation disallowed by embedder in Chrome

白昼怎懂夜的黑 提交于 2020-07-22 04:35:49
问题 I am embedding a WebGL game built in Unity on my web app built in Flask. I use a CSP for security purposes on the backend but even after including the wasm-eval directive in my CSP, I continue to get these errors only in Chrome: UnityLoader.js:4 failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder printErr @ UnityLoader.js:4 UnityLoader.js:4 CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by

Using Firebase with Unity and WebGL

六月ゝ 毕业季﹏ 提交于 2020-07-09 05:01:06
问题 I was thinking of using Firebase remote config with my Unity based game. I intent to release the game on Facebook with WebGL, and was wondering if there is Firebase implementation for WebGL as part of the SDK? 回答1: Firebase-Unity SDK is only for IOS and Android Platforms. However you can implement plugin to use web API for your WebGL build. If you would release your game on Facebook platform its better to use Parse.com. However WebGL is not supported in main SDK because its multi-threaded

Unity3D WebGL Headless not rendering

社会主义新天地 提交于 2020-04-18 06:10:32
问题 I have posted the same question over Unity's forum, but there hasn't been any answer and thus posting it here, too. I have been trying to run a Unity WebGL build in headless mode (through puppeteer) while saving 'screenshots' of the game, but the camera rendering doesn't seem to be working. The resulting images are all black . It works as expected when not in headless mode (but still WebGL ). It also works properly in standalone builds (e.g., windows, mac), through -batchMode . Here's the

Unity WebGL does not Post to Azure Function app: form already read error

有些话、适合烂在心里 提交于 2020-04-12 07:24:26
问题 Tested for Unity 2019.3.0f3 or 2019.3.0f5 or 2019.3.9 and Azure Functions V3. I Post from a Unity WebGL project to an azure function as form. I can't get the post into variables in the Function app: the Function app throws http 500 with "Unexpected end of Stream, the content may have already been read by another component.". So when webgl project is run on browser, chrome shows 500 internal error; firefox doesn't show the data on console but neither shows the error but you can see http 500

Firebase in Unity WebGL build

别来无恙 提交于 2020-04-10 14:50:47
问题 Is there any way at all to use a realtime database in a Unity WebGL project? If i understand right, the database unity SDK will work, but not the auth SDK, is that right? (Why is that, and is it likely to change in the near future?) The alternatives i can see are: 1) use the REST API to do auth (i've got this working in unity just using the WWW class), but then i can't see a way of using the auth token received from the REST API to authenticate with the database SDK. 2) write a WebGL plugin

Firebase in Unity WebGL build

北战南征 提交于 2020-04-10 14:50:38
问题 Is there any way at all to use a realtime database in a Unity WebGL project? If i understand right, the database unity SDK will work, but not the auth SDK, is that right? (Why is that, and is it likely to change in the near future?) The alternatives i can see are: 1) use the REST API to do auth (i've got this working in unity just using the WWW class), but then i can't see a way of using the auth token received from the REST API to authenticate with the database SDK. 2) write a WebGL plugin

Unity's WebGL not working with Firebase Hosting

有些话、适合烂在心里 提交于 2020-01-14 10:35:29
问题 I'm trying to deploy a WebGL built with Unity to Firebase Hosting, but I'm getting an error: Invoking error handler due to Uncaught SyntaxError: Unexpected token < . I can run it fine on localhost, though. I'm using the production build, not the development one, so I have the following file structure: index.html Release UnityLoader.js webgl.datagz webgl.jsgz webgl.memgz TemplateData (image, css and js files) Any ideas? Anyone faced this issue before? 来源: https://stackoverflow.com/questions

Call an Angular2 Function from Unity WebGL

微笑、不失礼 提交于 2020-01-04 05:28:10
问题 Currently I am working with Angular2 version 2.1.2 with a Unity visualizer, built with Unity 5.5. What I need to be able to do is communicate from Unity to Angular2. I was using code similar to below public void GetBillOfMaterials(string callbackFn) { var result = LightSystem.BillOfMaterials.Aggregate("", (current, material) => current + (material + Environment.NewLine)); Application.ExternalCall(callbackFn, result); } Where the above function would be called in Angular2 like below public

Importing a Unity WebGL-project into an Angular2 component

依然范特西╮ 提交于 2019-12-22 06:27:06
问题 I'm looking to integrate a Unity WebGL-project into an Angular2 app. What's the proper way to move all this script into an Angular2 component? First, the Unity WebGL exports an index.html like this: <!DOCTYPE html> <html lang="en-us"> <head> <meta charset="utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Unity WebGL Player | Espoo web manager (Prefab preview)</title> <link rel="shortcut icon" href="TemplateData/favicon.ico"> <link rel="stylesheet" href=

Application.streamingAssetsPath and WebGL build

孤人 提交于 2019-12-18 09:05:16
问题 In a project I'm working on I have two json files in the StreamingAssets directory. The script that handles them works perfectly in a Standalone PC build but doesn't work at all in a WebGL one. I'm getting the "Cannot find file!" message according to the script: else if (!File.Exists (filePath)) { Debug.LogError ("Cannot find file!"); } I was given the answer to use the WWW class as described in the scripting API on Unity Technologies site at this address: https://docs.unity3d.com