Loading a Web

How to load web UI.

Getting the Web View

The first step to loading a web is finding a Web View UGUI component that can load it.

Active

You can get the active web view with WebViewUGUI.Active.

WebViewUGUI myWebView = WebViewUGUI.Active;

If you have multiple web view components in your scene that the player can switch through, you can set the active one with the SetActive method. You will need the reference to the specific WebViewUGUI component.

myOtherWebView.SetActive();

Find

Alternatively, you can find a specific web view with the name of the web graph that it's meant for (the "Web Name" field set from the inspector).

WebViewUGUI myWebView = WebViewUGUI.Find("My Web Name");

Load/Unload

To load a web in the UI, you have to use the Web View UGUI component. Ensure there's an instance of one in your scene.

If you have a reference to a Web, you can use the Load method. This will create the UI for a specific web. If a previous web is loaded, it will be unloaded.

myWebView.Load(myWeb);

You can unload the loaded web (remove its UI) with the Unload method.

myWebView.Unload();

Last updated