This commit is contained in:
2020-07-11 12:36:54 +08:00
parent f563839566
commit e84465cd64
26 changed files with 247 additions and 248 deletions

View File

@@ -1768,6 +1768,7 @@ static public class NGUITools
}
}
/*
public static bool isIphonex() {
#if UNITY_IOS
#if UNITY_2017_1_OR_NEWER
@@ -1791,42 +1792,46 @@ static public class NGUITools
#endif
return false;
}
*/
//static bool _isFringe = false;
//public static bool isFringe { // 刘海屏
// get {
// return _isFringe || isIphonex ();
// }
// set {
// _isFringe = value;
// }
//}
static bool _isFringe = false;
public static bool isFringe { // 刘海屏
get {
return _isFringe || isIphonex ();
}
set {
_isFringe = value;
}
}
static float _rateFringe = 1;
public static float rateFringe {
get {
if (isFringe) {
return 734f / 812f;
} else {
return _rateFringe;
}
}
set {
_rateFringe = value;
}
}
//static float _rateFringe = 1;
//public static float rateFringe {
// get {
// if (isFringe) {
// return 734f / 812f;
// } else {
// return _rateFringe;
// }
// }
// set {
// _rateFringe = value;
// }
//}
public static Vector4 _offsetRect;
static bool initOffsetRect = false;
public static Vector4 offsetRect
{
get
{
if (_offsetRect == null)
{
if (!initOffsetRect)
{
initOffsetRect = true;
Debug.LogWarning("Screen.safeArea)========"+Screen.safeArea);
Debug.LogWarning(Screen.width+","+ Screen.height);
float left = Screen.safeArea.x;
float right = Screen.width - Screen.safeArea.width - left;
float top = Screen.safeArea.y;
float bottom = Screen.height - Screen.safeArea.height - top;
float bottom = Screen.safeArea.y;
float top = Screen.height - Screen.safeArea.height - bottom;
_offsetRect = new Vector4(left/Screen.width, top / Screen.height, right / Screen.width, bottom / Screen.height);
}