|
|
|
|
|
|
return _devicePixelRatio; |
|
|
|
} |
|
|
|
|
|
|
|
#if UNITY_ANDROID
|
|
|
|
#if UNITY_ANDROID
|
|
|
|
|
|
|
|
#if UNITY_WEBGL
|
|
|
|
|
|
|
|
#if UNITY_WEBGL
|
|
|
|
|
|
|
|
#if UNITY_IOS
|
|
|
|
|
|
|
|
#if UNITY_IOS
|
|
|
|
_devicePixelRatio = IOSDeviceSaleFactor(); |
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return _devicePixelRatio; |
|
|
|
} |
|
|
|
|
|
|
|
#if UNITY_ANDROID
|
|
|
|
#if UNITY_ANDROID
|
|
|
|
static float AndroidDevicePixelRatio() { |
|
|
|
using ( |
|
|
|
AndroidJavaClass unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer") |
|
|
|
|
|
|
[DllImport("__Internal")] |
|
|
|
static extern int IOSDeviceSaleFactor(); |
|
|
|
#endif
|
|
|
|
|
|
|
|
} |
|
|
|
} |