SystemInfo 类

(未完待续)

访问系统和硬件信息。
使用这个类可以了解底层平台和硬件的功能。例如,您可以检查支持哪种RenderTexture格式(SupportsRenderTextureFormat)、可用多少个CPU线程(ProcessorCount)等等。

SystemInfo 类

三个静态函数 ,返回类型 bool,验证是否支持 某种贴图类型,传入参数为 TextureFormat、RenderTextureFormat

很多个静态属性。。。。


public class StstemInfoTest : MonoBehaviour 
{
    public Vector2 scrollPosition;

    void OnGUI()
    {
        scrollPosition = GUILayout.BeginScrollView (scrollPosition);

        DD ("SystemInfo.batteryLevel",SystemInfo.batteryLevel);
        DD ("SystemInfo.batteryStatus",SystemInfo.batteryStatus);
        DD ("SystemInfo.copyTextureSupport",SystemInfo.copyTextureSupport);
        DD ("SystemInfo.deviceModel",SystemInfo.deviceModel);
        DD ("SystemInfo.deviceName",SystemInfo.deviceName);
        DD ("SystemInfo.deviceType",SystemInfo.deviceType);
        DD ("SystemInfo.deviceUniqueIdentifier",SystemInfo.deviceUniqueIdentifier);
        DD ("SystemInfo.graphicsDeviceID",SystemInfo.graphicsDeviceID);
        DD ("SystemInfo.graphicsDeviceName",SystemInfo.graphicsDeviceName);
        DD ("SystemInfo.graphicsDeviceType",SystemInfo.graphicsDeviceType);
        DD ("SystemInfo.graphicsDeviceVendor",SystemInfo.graphicsDeviceVendor);
        DD ("SystemInfo.graphicsDeviceVendorID",SystemInfo.graphicsDeviceVendorID);
        DD ("SystemInfo.graphicsDeviceVersion",SystemInfo.graphicsDeviceVersion);
        DD ("SystemInfo.graphicsMemorySize",SystemInfo.graphicsMemorySize);
        DD ("SystemInfo.graphicsMultiThreaded",SystemInfo.graphicsMultiThreaded);
        DD ("SystemInfo.graphicsShaderLevel",SystemInfo.graphicsShaderLevel);
        DD ("SystemInfo.graphicsUVStartsAtTop",SystemInfo.graphicsUVStartsAtTop);
        DD ("SystemInfo.maxCubemapSize",SystemInfo.maxCubemapSize);
        DD ("SystemInfo.maxTextureSize",SystemInfo.maxTextureSize);
        DD ("SystemInfo.npotSupport",SystemInfo.npotSupport);
        DD ("SystemInfo.operatingSystem",SystemInfo.operatingSystem);
        DD ("SystemInfo.operatingSystemFamily",SystemInfo.operatingSystemFamily);
        DD ("SystemInfo.processorCount",SystemInfo.processorCount);
        DD ("SystemInfo.processorType",SystemInfo.processorType);
        DD ("SystemInfo.processorFrequency",SystemInfo.processorFrequency);

        DD ("SystemInfo.supportedRenderTargetCount",SystemInfo.supportedRenderTargetCount);
        DD ("SystemInfo.supports2DArrayTextures",SystemInfo.supports2DArrayTextures);

        DD ("SystemInfo.supports3DRenderTextures",SystemInfo.supports3DRenderTextures);
        DD ("SystemInfo.supports3DTextures",SystemInfo.supports3DTextures);
        DD ("SystemInfo.supportsAccelerometer",SystemInfo.supportsAccelerometer);
        DD ("SystemInfo.supportsAsyncCompute",SystemInfo.supportsAsyncCompute);

        DD ("SystemInfo.supportsAudio",SystemInfo.supportsAudio);
        DD ("SystemInfo.supportsComputeShaders",SystemInfo.supportsComputeShaders);

        DD ("SystemInfo.supportsCubemapArrayTextures",SystemInfo.supportsCubemapArrayTextures);
        DD ("SystemInfo.supportsGPUFence",SystemInfo.supportsGPUFence);
        DD ("SystemInfo.supportsGyroscope",SystemInfo.supportsGyroscope);
        DD ("SystemInfo.supportsImageEffects",SystemInfo.supportsImageEffects);
        DD ("SystemInfo.supportsInstancing",SystemInfo.supportsInstancing);
        DD ("SystemInfo.supportsLocationService",SystemInfo.supportsLocationService);
        DD ("SystemInfo.supportsMotionVectors",SystemInfo.supportsMotionVectors);

        DD ("SystemInfo.supportsMultisampledTextures",SystemInfo.supportsMultisampledTextures);
        DD ("SystemInfo.supportsRawShadowDepthSampling",SystemInfo.supportsRawShadowDepthSampling);
        DD ("SystemInfo.supportsRenderToCubemap",SystemInfo.supportsRenderToCubemap);
        DD ("SystemInfo.supportsShadows",SystemInfo.supportsShadows);
        DD ("SystemInfo.supportsSparseTextures",SystemInfo.supportsSparseTextures);
        DD ("SystemInfo.supportsTextureWrapMirrorOnce",SystemInfo.supportsTextureWrapMirrorOnce);

        DD ("SystemInfo.supportsVibration",SystemInfo.supportsVibration);
        DD ("SystemInfo.systemMemorySize",SystemInfo.systemMemorySize);
        DD ("SystemInfo.unsupportedIdentifier",SystemInfo.unsupportedIdentifier);
        DD ("SystemInfo.usesReversedZBuffer",SystemInfo.usesReversedZBuffer);


        GUILayout.EndScrollView ();
    }

    void DD(string str,object obj)
    {
        GUILayout.Label (str + " :     " + obj.ToString());
    }

}

你可能感兴趣的:(Unity,一个个类)