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());
}
}
---------------------
作者:zts_coding
来源:CSDN
原文:https://blog.csdn.net/douniwan007009/article/details/79513465