安卓判断:
float physicscreen = Mathf.Sqrt(Screen.width * Screen.width + Screen.height * Screen.height) / Screen.dpi;
if (physicscreen >= 7f)
{
Debug.Log(“安卓平板”);
}else{
Debug.Log(“安卓手机”);
}
ios判断:
string iP_genneration = UnityEngine.iOS.Device.generation.ToString();
if (iP_genneration.Substring(0, 3) == “iPa”)
{
Debug.Log(“苹果平板”);
}else
{
Debug.Log(“苹果手机”);
}