SystemInfo 类

37 篇文章 0 订阅

(未完待续)

访问系统和硬件信息。
使用这个类可以了解底层平台和硬件的功能。例如,您可以检查支持哪种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());
    }
}


---------------------
作者:zts_coding
来源:CSDN
原文:https://blog.csdn.net/douniwan007009/article/details/79513465
版权声明:本文为博主原创文章,转载请附上博文链接!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值