Skip to content

Commit b93d6c3

Browse files
committed
Add runtime/headless doc
1 parent f7c567a commit b93d6c3

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

docs/articles/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
href: user/javascript.md
2424
- name: Client Events
2525
href: user/events.md
26+
- name: Runtime Creation
27+
href: user/runtime.md
2628
- name: Player Build
2729
href: user/player-build.md
2830

docs/articles/user/runtime.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Runtime Creation
2+
3+
The <xref:VoltstroStudios.UnityWebBrowser.Core.WebBrowserClient> can be created manually at runtime without the usage of <xref:VoltstroStudios.UnityWebBrowser.WebBrowserUIBasic> or <xref:VoltstroStudios.UnityWebBrowser.WebBrowserUIFull>.
4+
5+
When instantiating the class, you will need to set all required properties yourself.
6+
7+
> [!NOTE]
8+
> <xref:VoltstroStudios.UnityWebBrowser.Communication.CommunicationLayer> and <xref:VoltstroStudios.UnityWebBrowser.Core.Engines.Engine> objects are Unity's [ScriptableObject](https://docs.unity3d.com/2021.3/Documentation/Manual/class-ScriptableObject.html). The associated properties on <xref:VoltstroStudios.UnityWebBrowser.Core.WebBrowserClient> must be set to a ScriptableObject instance, or created at runtime through the [`ScriptableObject.CreateInstance()`](https://docs.unity3d.com/2021.3/Documentation/ScriptReference/ScriptableObject.CreateInstance.html) method.
9+
10+
There is a sample script that creates everything including the canvas, the <xref:VoltstroStudios.UnityWebBrowser.Core.WebBrowserClient.engine>, the <xref:VoltstroStudios.UnityWebBrowser.Core.WebBrowserClient.communicationLayer> and the <xref:VoltstroStudios.UnityWebBrowser.Core.WebBrowserClient> instance it self. You can import the script straight into your Unity project via the sample sections of the UWB package, or you can [view the script in GitHub](https://github.com/Voltstro-Studios/UnityWebBrowser/blob/master/src/Packages/UnityWebBrowser/Samples~/Runtime/Scripts/UWBRuntime.cs).
11+
12+
## Headless Mode
13+
14+
<xref:VoltstroStudios.UnityWebBrowser.Core.WebBrowserClient> constructor includes a `headless` parameter. When set to `true`, UWB will run in headless mode.
15+
16+
Headless mode will not create a <xref:VoltstroStudios.UnityWebBrowser.Core.WebBrowserClient.BrowserTexture>, and it will not run UWB's internal pixel data thread. All other methods that the <xref:VoltstroStudios.UnityWebBrowser.Core.WebBrowserClient> has are available.

0 commit comments

Comments
 (0)