Class CrossPlatformSupportUtils
A utility class for handling platform-specific functionality and platform checks, including WebGL support checks, mobile platform detection, and WebGL alert displays.
public class CrossPlatformSupportUtils
Inheritance
Methods
DisplayAlert(string)
Displays an alert message in WebGL builds or logs a warning in the Unity Editor.
public static void DisplayAlert(string str)
Parameters
| Name | Type | Description |
|---|---|---|
str | string | The message to display in the WebGL alert or log as a warning in Unity Editor. |
IsMobile()
Checks if the application is running on a mobile platform in a WebGL build.
public static bool IsMobile()
Returns
bool — Returns true if running on a mobile platform in WebGL, false otherwise.
OpenBlankPage()
public static extern void OpenBlankPage()
Quit()
Quits the game safely. The behavior of Quit() is platform-specific. In the editor, stops play mode; on WebGL, opens a blank page in the same tab; otherwise quits the app.
public static void Quit()