zoukankan      html  css  js  c++  java
  • unity中获取设备的信息

    今天在看代码的时候,无意中发现unity中的SystemInfo类,感觉这个类很有意思,通过该类,可以获取到有关系统的一些信息。

      1 #region 程序集 UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
      2 // D:1_WorkSoftwareUnity2017.2.0p4UnityEditorDataManagedUnityEngine.dll
      3 #endregion
      4 
      5 using System;
      6 using UnityEngine.Rendering;
      7 using UnityEngine.Scripting;
      8 
      9 namespace UnityEngine
     10 {
     11     //
     12     // 摘要:
     13     //     Access system and hardware information.
     14     public sealed class SystemInfo
     15     {
     16         //
     17         // 摘要:
     18         //     Value returned by SystemInfo string properties which are not supported on the
     19         //     current platform.
     20         public const string unsupportedIdentifier = "n/a";
     21 
     22         public SystemInfo();
     23 
     24         //
     25         // 摘要:
     26         //     Are image effects supported? (Read Only)
     27         public static bool supportsImageEffects { get; }
     28         //
     29         // 摘要:
     30         //     Are 3D (volume) textures supported? (Read Only)
     31         public static bool supports3DTextures { get; }
     32         //
     33         // 摘要:
     34         //     Are 2D Array textures supported? (Read Only)
     35         public static bool supports2DArrayTextures { get; }
     36         //
     37         // 摘要:
     38         //     Are 3D (volume) RenderTextures supported? (Read Only)
     39         public static bool supports3DRenderTextures { get; }
     40         //
     41         // 摘要:
     42         //     Are Cubemap Array textures supported? (Read Only)
     43         public static bool supportsCubemapArrayTextures { get; }
     44         //
     45         // 摘要:
     46         //     Support for various Graphics.CopyTexture cases (Read Only).
     47         public static CopyTextureSupport copyTextureSupport { get; }
     48         //
     49         // 摘要:
     50         //     Are compute shaders supported? (Read Only)
     51         public static bool supportsComputeShaders { get; }
     52         //
     53         // 摘要:
     54         //     Is GPU draw call instancing supported? (Read Only)
     55         public static bool supportsInstancing { get; }
     56         //
     57         // 摘要:
     58         //     Are sparse textures supported? (Read Only)
     59         public static bool supportsSparseTextures { get; }
     60         //
     61         // 摘要:
     62         //     How many simultaneous render targets (MRTs) are supported? (Read Only)
     63         public static int supportedRenderTargetCount { get; }
     64         //
     65         // 摘要:
     66         //     Returns true if the 'Mirror Once' texture wrap mode is supported. (Read Only)
     67         public static int supportsTextureWrapMirrorOnce { get; }
     68         //
     69         // 摘要:
     70         //     This property is true if the current platform uses a reversed depth buffer (where
     71         //     values range from 1 at the near plane and 0 at far plane), and false if the depth
     72         //     buffer is normal (0 is near, 1 is far). (Read Only)
     73         public static bool usesReversedZBuffer { get; }
     74         //
     75         // 摘要:
     76         //     Is the stencil buffer supported? (Read Only)
     77         [Obsolete("supportsStencil always returns true, no need to call it")]
     78         public static int supportsStencil { get; }
     79         //
     80         // 摘要:
     81         //     What NPOT (non-power of two size) texture support does the GPU provide? (Read
     82         //     Only)
     83         public static NPOTSupport npotSupport { get; }
     84         //
     85         // 摘要:
     86         //     A unique device identifier. It is guaranteed to be unique for every device (Read
     87         //     Only).
     88         public static string deviceUniqueIdentifier { get; }
     89         //
     90         // 摘要:
     91         //     The user defined name of the device (Read Only).
     92         public static string deviceName { get; }
     93         //
     94         // 摘要:
     95         //     The model of the device (Read Only).
     96         public static string deviceModel { get; }
     97         //
     98         // 摘要:
     99         //     Is an accelerometer available on the device?
    100         public static bool supportsAccelerometer { get; }
    101         //
    102         // 摘要:
    103         //     Is a gyroscope available on the device?
    104         public static bool supportsGyroscope { get; }
    105         //
    106         // 摘要:
    107         //     Is the device capable of reporting its location?
    108         public static bool supportsLocationService { get; }
    109         //
    110         // 摘要:
    111         //     Is the device capable of providing the user haptic feedback by vibration?
    112         public static bool supportsVibration { get; }
    113         //
    114         // 摘要:
    115         //     Is there an Audio device available for playback?
    116         public static bool supportsAudio { get; }
    117         //
    118         // 摘要:
    119         //     Returns the kind of device the application is running on (Read Only).
    120         public static DeviceType deviceType { get; }
    121         //
    122         // 摘要:
    123         //     Are cubemap render textures supported? (Read Only)
    124         public static bool supportsRenderToCubemap { get; }
    125         //
    126         // 摘要:
    127         //     Whether motion vectors are supported on this platform.
    128         public static bool supportsMotionVectors { get; }
    129         //
    130         // 摘要:
    131         //     Are render textures supported? (Read Only)
    132         [Obsolete("supportsRenderTextures always returns true, no need to call it")]
    133         public static bool supportsRenderTextures { get; }
    134         //
    135         // 摘要:
    136         //     Is sampling raw depth from shadowmaps supported? (Read Only)
    137         public static bool supportsRawShadowDepthSampling { get; }
    138         //
    139         // 摘要:
    140         //     The current battery level (Read Only).
    141         public static float batteryLevel { get; }
    142         //
    143         // 摘要:
    144         //     Returns the current status of the device's battery (Read Only).
    145         public static BatteryStatus batteryStatus { get; }
    146         //
    147         // 摘要:
    148         //     Operating system name with version (Read Only).
    149         public static string operatingSystem { get; }
    150         //
    151         // 摘要:
    152         //     Returns the operating system family the game is running on (Read Only).
    153         public static OperatingSystemFamily operatingSystemFamily { get; }
    154         //
    155         // 摘要:
    156         //     Processor name (Read Only).
    157         public static string processorType { get; }
    158         //
    159         // 摘要:
    160         //     Processor frequency in MHz (Read Only).
    161         public static int processorFrequency { get; }
    162         //
    163         // 摘要:
    164         //     Number of processors present (Read Only).
    165         public static int processorCount { get; }
    166         //
    167         // 摘要:
    168         //     Amount of system memory present (Read Only).
    169         public static int systemMemorySize { get; }
    170         //
    171         // 摘要:
    172         //     Amount of video memory present (Read Only).
    173         public static int graphicsMemorySize { get; }
    174         //
    175         // 摘要:
    176         //     Maximum texture size (Read Only).
    177         public static int maxTextureSize { get; }
    178         //
    179         // 摘要:
    180         //     The name of the graphics device (Read Only).
    181         public static string graphicsDeviceName { get; }
    182         //
    183         // 摘要:
    184         //     The identifier code of the graphics device (Read Only).
    185         public static int graphicsDeviceID { get; }
    186         //
    187         // 摘要:
    188         //     The identifier code of the graphics device vendor (Read Only).
    189         public static int graphicsDeviceVendorID { get; }
    190         //
    191         // 摘要:
    192         //     The graphics API type used by the graphics device (Read Only).
    193         public static GraphicsDeviceType graphicsDeviceType { get; }
    194         //
    195         // 摘要:
    196         //     Returns true if the texture UV coordinate convention for this platform has Y
    197         //     starting at the top of the image.
    198         public static bool graphicsUVStartsAtTop { get; }
    199         //
    200         // 摘要:
    201         //     The graphics API type and driver version used by the graphics device (Read Only).
    202         public static string graphicsDeviceVersion { get; }
    203         //
    204         // 摘要:
    205         //     Graphics device shader capability level (Read Only).
    206         public static int graphicsShaderLevel { get; }
    207         [Obsolete("graphicsPixelFillrate is no longer supported in Unity 5.0+.")]
    208         public static int graphicsPixelFillrate { get; }
    209         [Obsolete("Vertex program support is required in Unity 5.0+")]
    210         public static bool supportsVertexPrograms { get; }
    211         //
    212         // 摘要:
    213         //     Is graphics device using multi-threaded rendering (Read Only)?
    214         public static bool graphicsMultiThreaded { get; }
    215         //
    216         // 摘要:
    217         //     Are built-in shadows supported? (Read Only)
    218         public static bool supportsShadows { get; }
    219         //
    220         // 摘要:
    221         //     The vendor of the graphics device (Read Only).
    222         public static string graphicsDeviceVendor { get; }
    223         //
    224         // 摘要:
    225         //     Maximum Cubemap texture size (Read Only).
    226         public static int maxCubemapSize { get; }
    227 
    228         //
    229         // 摘要:
    230         //     Is render texture format supported?
    231         //
    232         // 参数:
    233         //   format:
    234         //     The format to look up.
    235         //
    236         // 返回结果:
    237         //     True if the format is supported.
    238         [GeneratedByOldBindingsGenerator]
    239         public static bool SupportsRenderTextureFormat(RenderTextureFormat format);
    240         //
    241         // 摘要:
    242         //     Is texture format supported on this device?
    243         //
    244         // 参数:
    245         //   format:
    246         //     The TextureFormat format to look up.
    247         //
    248         // 返回结果:
    249         //     True if the format is supported.
    250         [GeneratedByOldBindingsGenerator]
    251         public static bool SupportsTextureFormat(TextureFormat format);
    252     }
    253 }

    中文含义:

    参考:https://blog.csdn.net/rookie0518/article/details/53486125

  • 相关阅读:
    NFS(Network File System)即网络文件系统 (转)
    抓包神器 tcpdump 使用介绍 (转)
    sms短信网关对接
    spring 事务的传播级别和隔离级别
    持续集成是什么?
    理解Cookie和Session机制
    使用df -h命令查看磁盘空间使用率不算高,还有很多空余空间,但是创建文件或写入数据时一直报错磁盘写满
    删除文件后,磁盘空间没有释放的处理记录
    Springboot启动原理解析
    使用idea创建springboot项目
  • 原文地址:https://www.cnblogs.com/luguoshuai/p/12850267.html
Copyright © 2011-2022 走看看