Check if Mobile for Unity WebGL
>-
com.gigacee.checkifmobileforunitywebgl Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/track/checkifmobileforunitywebgl.git?path=Assets/Plugins/CheckIfMobileForUnityWebGL README
Check if Mobile for Unity WebGL
The plugin allows you to check if your Unity WebGL game is running on a PC or mobile device.
| on PC | on Mobile |
|---|---|
![]() |
![]() |
æ„æŹèȘă«ăăèȘŹæ / Explanation in Japanese
Usage
This script uses .jslib plugin. You can check if your Unity WebGL game is running on a PC or mobile device by calling IsMobile() in CheckIfMobileForUnityWebGL.jslib as follows:
#if !UNITY_EDITOR && UNITY_WEBGL
[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern bool IsMobile();
#endif
private void CheckIfMobile()
{
var isMobile = false;
#if !UNITY_EDITOR && UNITY_WEBGL
isMobile = IsMobile();
#endif
GetComponent<Text>().text = isMobile ? "Mobile" : "PC";
}
Installation
Package Manager
https://github.com/gigacee/CheckIfMobileForUnityWebGL.git?path=Assets/Plugins/CheckIfMobileForUnityWebGL
Manual
Copy Assets/Plugins/CheckIfMobileForUnityWebGL/CheckIfMobileForUnityWebGL.jslib to your project.
:warning: Be sure to put it in Assets/Plugins/ .
Total Installs
0
Last 30 daysUnique IPs
0
Approximate usersInstalls Over Time
Operating Systems
No data yet
Top Countries
No data yet
Git Versions
No data yet
Embed Install Badge
Add an install count badge to your README
Markdown
[](https://www.pkglnk.dev/pkg/checkifmobileforunitywebgl)HTML
<a href="https://www.pkglnk.dev/pkg/checkifmobileforunitywebgl"><img src="https://www.pkglnk.dev/badge/checkifmobileforunitywebgl.svg?style=pkglnk" alt="pkglnk installs"></a>

No comments yet. Be the first!