Links

WebViewPanel

WebView is a component of the WebViewCanvas prefab that is part of the Ready Player Me SDK. To use a WebView, create a WebViewCanvas game object by selecting using the Unity menu option GameObject > UI > Ready Player Me > WebView Canvas. Alternatively, you can right-click inside the scene hierarchy and select UI > Ready Player Me > WebView Canvas.
Ready Player Me website will work on Android devices with System WebView with a rendering engine equal to or newer than Chrome v70 or Firefox v64, and IOS devices with Webkit WebView equal to or newer than v600. This info is checked using the userAgent string of the WebView.

Properties

Property
Type
Description
screenPadding
ScreenPadding
Use this to define the padding properties used by the WebView UI
urlConfig
UrlConfig
Use this to define all the settings related to the URL. This will be used to generate the query parameters that get added to the URL.
Loaded
bool
Returns a boolean to indicate if the website has finished loading in the WebView.

Events

Event
EventArgs
Description
OnAvatarCreated
<string>
Event is called when an avatar is created. This event passes the avatar GLB URL.
OnUserSet
<string>
Event is called when a the user is set, either on start with an anonymous user or after a user has logged in. This event passes the UserID.
OnUserAuthorized
<string>
Event is call after a user has logged in. This event passes the UserID.
OnAssetUnlock
<AssetRecord>
Event is called when a request has been made to unlock a locked asset. This event passes an AssetRecord that includes UserId and AssetId.

Public Methods

Method
Returns
Description
LoadWebView(string loginToken)
void
Creates the WebView window and loads the Ready Player Me website. The loginToken is an optional parameter that can be used to automatically login with an RPM account. The loginToken parameter will default to empty if not specified.
ReloadWithLoginToken(string loginToken)
void
This function can be used to reload the current URL with the specified loginToken.
SetScreenPadding()
void
Sets the screen padding of the WebView window based on the screenPadding property settings.
SetVisible(bool visible)
void
Sets the visibility of the WebView.