Install the UWebView2
Import and create a simple canvas from scratch.
Getting Started
- Import Unity Package.
- Check the system's built-in runtime version.
Create a new UGUI EdgeCanvas
Right-click in the Unity Hierarchy window to pop up the creation menu.
You can modify this Source property, which will load the specified URL after the canvas initializes.
tip
If you don't want to use the Source property, you can also use code to initialize and load in the Awake method
public class test : MonoBehaviour
{
public EdgeCanvas m_edgeCanvas;
// Method A
private void Awake()
{
m_edgeCanvas.WaitInitialize(edge =>
{
edge.LoadUrl("https://bing.com")
});
}
// Or
// Method B
private async void Awake()
{
await m_edgeCanvas.WaitInitialize();
m_edgeCanvas.LoadUrl("https://bing.com");
}
}
Play
Once it starts running, you will see the following screen: