using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Runtime.InteropServices; public class MobileDetection : MonoBehaviour { [DllImport("__Internal")] private static extern bool IsMobile(); private bool _checkMobile; public GameObject _bTNLoadUDTLocal; public GameObject _bTNSaveOKLocal; public GameObject _bTNSavePDFLocal; public GameObject _bTNLoadUDTMobile; public GameObject _bTNSaveOKMobile; public GameObject _bTNSavePDFMobile; private void Start() { #if UNITY_WEBGL && !UNITY_EDITOR _checkMobile = IsMobile(); #endif } public void Update() { _G.Mobile=_checkMobile; if (_checkMobile == true) { _G.Mobile=true; //_bTNLoadUDTLocal.SetActive(false); //_bTNSaveOKLocal.SetActive(false); //_bTNSavePDFLocal.SetActive(false); //_bTNLoadUDTMobile.SetActive(true); //_bTNSaveOKMobile.SetActive(true); //_bTNSavePDFMobile.SetActive(true); } else { //_bTNLoadUDTLocal.SetActive(true); //_bTNSaveOKLocal.SetActive(true); //_bTNSavePDFLocal.SetActive(true); //_bTNLoadUDTMobile.SetActive(false); //_bTNSaveOKMobile.SetActive(false); //_bTNSavePDFMobile.SetActive(false); } if(Input.touchCount > 0){ _G.TOUCH=true; //_bTNSaveOKLocal.SetActive(false); //_bTNSaveOKMobile.SetActive(true); } else { _G.TOUCH=false; //_bTNSaveOKLocal.SetActive(true); //_bTNSaveOKMobile.SetActive(false); } //if(Input.touchCount == 0 && _G.SM== "zoomTouch"){_G.SM= "navigate";} } }