Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

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

Unity WebGL ăźćźŸèĄŒç’°ćąƒăŒ PC ă‹ăƒąăƒă‚€ăƒ«ç«Żæœ«ă‹ă‚’ćˆ€ćˆ„ă™ă‚‹ă‚čクăƒȘăƒ—ăƒˆă‚’ć…Źé–‹ă—ăŸă—ăŸ

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 days
Unique IPs
0
Approximate users

Installs 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

Style
Preview
pkglnk installs badge
Markdown
[![pkglnk installs](https://www.pkglnk.dev/badge/checkifmobileforunitywebgl.svg?style=pkglnk)](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>

Comments

No comments yet. Be the first!