Skip to content

Commit 7f94088

Browse files
committedNov 21, 2021
Update readme with unity bridge information
1 parent 6fe2765 commit 7f94088

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed
 

‎README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
* GPU Instancing for materials
1515
* Shadows
1616
* Brotli Compression
17-
* Togglable In-DOM Debug console ([Example](https://deml.io/experiments/unity-webgl/2021.1.4f1/))
17+
* Togglable In-DOM Debug console ([Demo](https://deml.io/experiments/unity-webgl/2021.1.4f1/))
18+
* Easy access to unity functions through the browser console ([Demo](https://deml.io/experiments/unity-webgl/2020.3.23f1/)|[Youtube](https://youtu.be/OjypxsD6XMI))
1819
* Handy debug functions for times and memory consumption
1920
* Responsive template layout for maximum mobile compatibility
2021
* Works with [Unity WebGL Publisher](https://play.unity.com/discover/all-showcases) (Use [2020.3-lts](https://github.com/JohannesDeml/UnityWebGL-LoadingTest/tree/2020-lts) or [2020.3-lts-urp](https://github.com/JohannesDeml/UnityWebGL-LoadingTest/tree/2020-lts-urp) branch)
@@ -93,6 +94,20 @@ Version | Size | Link
9394
* Enable Exceptions: `None`
9495
* C++ Compiler Configuration: `Master`
9596
97+
## Browser Console commands
98+
99+
*This functionality was added 2021-11-21 and is only supported by releases starting at that date*
100+
101+
The script `WebGlBridge` adds an easy to access gameobject that can be called from the browser console through `unityGame.SendMessage("WebGL", "COMMAND_NAME",PARAMETER)`
102+
103+
Currently the following commands are available:
104+
105+
* `LogMemory()` : logs the current memory consumption
106+
* `SetApplicationRunInBackground(int runInBackground)` : [Application.runInBackground](https://docs.unity3d.com/ScriptReference/Application-runInBackground.html)
107+
* `SetApplicationTargetFrameRate(int targetFrameRate)` : [Application.targetFrameRate](https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html)
108+
* `SetTimeFixedDeltaTime(float fixedDeltaTime)` : [Time.fixedDeltaTime](https://docs.unity3d.com/ScriptReference/Time-fixedDeltaTime.html)
109+
* `SetTimeTimeScale(float timeScale)` : [Time.timeScale](https://docs.unity3d.com/ScriptReference/Time-timeScale.html)
110+
96111
## Older versions
97112
| Version | Size | Link |
98113
| ---------- | ------- | --------------------------------------------------- |

0 commit comments

Comments
 (0)
Please sign in to comment.