浏览代码

adjust screen scale for some ios devices

/main
xingwei.zhu 5 年前
当前提交
6bb0a3a3
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 9
      Runtime/Plugins/platform/ios/DeviceScreen.mm
  2. 2
      Runtime/engine/DisplayMetrics.cs

9
Runtime/Plugins/platform/ios/DeviceScreen.mm


#import <UIKit/UIKit.h>
#import "UIWidgetsDevice.h"
int IOSDeviceScaleFactor()
float IOSDeviceScaleFactor()
return [[UIScreen mainScreen] scale];
float scale = [[UIScreen mainScreen] scale] * 1.0;
if ([UIWidgetsDevice NeedScreenDownSample]) {
scale *= 0.8696;
}
return scale;
}
}

2
Runtime/engine/DisplayMetrics.cs


#if UNITY_IOS
[DllImport("__Internal")]
static extern int IOSDeviceScaleFactor();
static extern float IOSDeviceScaleFactor();
[DllImport("__Internal")]
static extern viewMetrics IOSGetViewportPadding();

正在加载...
取消
保存