浏览代码

fix ios build error

/main
fzhangtj 6 年前
当前提交
455309a2
共有 1 个文件被更改,包括 20 次插入11 次删除
  1. 31
      Runtime/engine/DisplayMetrics.cs

31
Runtime/engine/DisplayMetrics.cs


return _devicePixelRatio;
}
if (Application.platform == RuntimePlatform.Android) {
_devicePixelRatio = DevicePixelRatioAndroid();
} else if (Application.platform == RuntimePlatform.WebGLPlayer) {
_devicePixelRatio = UIWidgetsWebGLDevicePixelRatio();
} else if (Application.platform == RuntimePlatform.IPhonePlayer ||
Application.platform == RuntimePlatform.tvOS) {
_devicePixelRatio = IOSDeviceSaleFactor();
}
#if UNITY_ANDROID
_devicePixelRatio = AndroidDevicePixelRatio();
#endif
#if UNITY_WEBGL
_devicePixelRatio = UIWidgetsWebGLDevicePixelRatio();
#endif
#if UNITY_IOS
_devicePixelRatio = IOSDeviceSaleFactor();
#endif
if (_devicePixelRatio <= 0) {
_devicePixelRatio = 1;

}
}
}
static float DevicePixelRatioAndroid() {
#if UNITY_ANDROID
static float AndroidDevicePixelRatio() {
using (
AndroidJavaClass unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")
) {

}
}
}
#endif
#if UNITY_WEBGL
#endif
#if UNITY_IOS
#endif
}
}
正在加载...
取消
保存