///Check the current device is tablet or not
private void
checkTheCurrentDevice()
{
#if UNITY_IPHONE
string
deviceModel =
SystemInfo.deviceModel.ToLower().Trim();
if(deviceModel.StartsWith("ipad"))
{
bIsTablet
= true;
}
else
{
bIsTablet = false;
}
#elif UNITY_ANDROID
float
physicScreenSize = Mathf.Sqrt(Screen.width * Screen.width + Screen.height *
Screen.height) / Screen.dpi;
if(physicScreenSize >= 7f) //If the screen
size is >= 7 inches, it‘s a tablet
{
bIsTablet =
true;
}
else
{
bIsTablet = false;
}
#else
bIsTablet =
false;
#endif
// bIsTablet = false;
}
相关文章
- 11-17android – 1280 x 800平板电脑大小 – 是tvdpi还是xhdpi?还是mdpi大小?
- 11-17dotnet OpenXML 如何判断是形状还是文本
- 11-17jenkins 判断是手动触发还是定时器触发
- 11-17【WPF】判断TabControl是用户按下鼠标切换还是软件自动切换
- 11-17springMVC如何判断入参是默认参数还是请求传过来的参数?
- 11-17jq判断是否是手机端还是PC端
- 11-17sql server int 列 NULLIF,isnull 判断是0还是1 ,如果是0就变成1
- 11-17js判断手机端还是电脑PC端(以及注意事项)
- 11-17Cloud for Customer的前端如何判断自己是运行在PC浏览器还是移动设备里
- 11-17如何判断页面是通过链接打开还是通过后退按钮返回打开的?