I know I can check if it’s an iPhone, or Android, or whatever, but like, if it’s running on Windows 8, it might be a desktop or tablet, and if it’s a tablet it can support tilt. Is there a way to tell?
Thanks
I know I can check if it’s an iPhone, or Android, or whatever, but like, if it’s running on Windows 8, it might be a desktop or tablet, and if it’s a tablet it can support tilt. Is there a way to tell?
Thanks
Make a new project and attach this script to the camera and make a build.
using UnityEngine;
using System.Collections;
public class DetectDevice : MonoBehaviour {
private string DeviceType;
private string shaderSupport;
// Use this for initialization
void Start () {
Debug.Log( SystemInfo.deviceType);
//DeviceType = SystemInfo.deviceType;
if (SystemInfo.graphicsShaderLevel == 30)
{
shaderSupport = "Shader Model 3.0";
}
if (SystemInfo.graphicsShaderLevel == 20)
{
shaderSupport = "Shader Model 2.0";
}
if (SystemInfo.graphicsShaderLevel == 10)
{
shaderSupport = "Shader Model 1.0";
}
if (SystemInfo.graphicsShaderLevel <= 7)
{
shaderSupport = "not good!!!!!!";
}
}
// Update is called once per frame
void Update () {
if (Input.GetKey("escape"))
Application.Quit();
}
void OnGUI()
{
GUI.Label(new Rect(10, 10, 500, 100), "Device Type: " + SystemInfo.deviceType);
GUI.Label(new Rect(10, 30, 500, 100), "Device Model: " + SystemInfo.deviceModel);
GUI.Label(new Rect(10, 50, 500, 100), "Device Version: " + SystemInfo.graphicsDeviceVersion);
GUI.Label(new Rect(10, 70, 500, 100), "Shader Support: " + shaderSupport);
GUI.Label(new Rect(10, 90, 500, 100), "Graphic Pixel Fill Rate: " + SystemInfo.graphicsPixelFillrate);
GUI.Label(new Rect(10, 110, 500, 100), "Supports Image Effects: " + SystemInfo.supportsImageEffects);
GUI.Label(new Rect(10, 130, 500, 100), "Supports Render Textures: " + SystemInfo.supportsRenderTextures);
GUI.Label(new Rect(10, 150, 500, 100), "Supports Shadows: " + SystemInfo.supportsShadows);
GUI.Label(new Rect(10, 170, 500, 100), "Supported Render Target Count: " + SystemInfo.supportedRenderTargetCount);
GUI.Label(new Rect(10, 190, 500, 100), "Supports Accelerometer: " + SystemInfo.supportsAccelerometer);
GUI.Label(new Rect(10, 210, 500, 100), "Supports Gyroscope: " + SystemInfo.supportsGyroscope);
}
}
Thanks!