我觉得用Unity 开发最爽的地方, 不是unity跨平台,而是用其他语言,要用很复杂的逻辑才能完成的功能,unity用一两句代码就能搞定

就比如说获取Android 系统的电量,不用发广播,不用申请权限,一句 SystemInfo.batteryLevel 轻松搞定。

关于设备信息,我们可以通过 SystemInfo类 来获得

Static Properties

batteryLevel 当前电量 (Read Only).
batteryStatus 返回电池的状态,是否在充电等 (Read Only).
copyTextureSupport 支持Graphics.CopyTexture的种类 (Read Only).
deviceModel The model of the device (Read Only).
deviceName The user defined name of the device (Read Only).
deviceType 返回本应用程序所正在运行的设备(Read Only).
deviceUniqueIdentifier 返回设备的唯一标识符 (Read Only).
graphicsDeviceID 图形设备的标识符
graphicsDeviceName 图形设备的名称
graphicsDeviceType The graphics API type used by the graphics device (Read Only).
graphicsDeviceVendor The vendor of the graphics device (Read Only).
graphicsDeviceVendorID The identifier code of the graphics device vendor (Read Only).
graphicsDeviceVersion The graphics API type and driver version used by the graphics device (Read Only).
graphicsMemorySize Amount of video memory present (Read Only).
graphicsMultiThreaded Is graphics device using multi-threaded rendering (Read Only)?
graphicsShaderLevel Graphics device shader capability level (Read Only).
graphicsUVStartsAtTop Returns true if the texture UV coordinate convention for this platform has Y starting at the top of the image.
maxCubemapSize Maximum Cubemap texture size (Read Only).
maxTextureSize Maximum texture size (Read Only).
npotSupport What NPOT (non-power of two size) texture support does the GPU provide? (Read Only)
operatingSystem Operating system name with version (Read Only).
operatingSystemFamily Returns the operating system family the game is running on (Read Only).
processorCount Number of processors present (Read Only).
processorFrequency Processor frequency in MHz (Read Only).
processorType Processor name (Read Only).
supportedRenderTargetCount How many simultaneous render targets (MRTs) are supported? (Read Only)
supports2DArrayTextures Are 2D Array textures supported? (Read Only)
supports3DRenderTextures Are 3D (volume) RenderTextures supported? (Read Only)
supports3DTextures Are 3D (volume) textures supported? (Read Only)
supportsAccelerometer Is an accelerometer available on the device?
supportsAudio Is there an Audio device available for playback?
supportsComputeShaders Are compute shaders supported? (Read Only)
supportsCubemapArrayTextures Are Cubemap Array textures supported? (Read Only)
supportsGyroscope Is a gyroscope available on the device?
supportsImageEffects Are image effects supported? (Read Only)
supportsInstancing Is GPU draw call instancing supported? (Read Only)
supportsLocationService Is the device capable of reporting its location?
supportsMotionVectors Whether motion vectors are supported on this platform.
supportsRawShadowDepthSampling Is sampling raw depth from shadowmaps supported? (Read Only)
supportsRenderToCubemap Are cubemap render textures supported? (Read Only)
supportsShadows Are built-in shadows supported? (Read Only)
supportsSparseTextures Are sparse textures supported? (Read Only)
supportsVibration 是否支持震动
systemMemorySize 内存大小
unsupportedIdentifier Value returned by SystemInfo string properties which are not supported on the current platform.
usesReversedZBuffer 如果当前平台使用反向深度缓冲区(取值范围从1附近的平面和0到远平面),如果深度缓冲区是正常的(0在附近,1则远),则此属性为true。(只读)

unity SystemInfo类 获得电量battery的更多相关文章

  1. Unity 改变类模板-为你的类添加一个命名空间

    之前在写代码的时候,就很疑惑为什么创建类的时候.没有命名空间呢?   后来自己的类终于和别人写的类名字有冲突.... 如何修改Unity创建类的模板呢?  找到下面这个文件 然后修改 保存文件在Uni ...

  2. Unity3D的SystemInfo类,用于获取运行设备硬件信息(CPU、显卡、类型等)

    SystemInfo类中的静态变量:   中文显示: Rendering.CopyTextureSupport copyTextureSupport:(只读)支持多种复制纹理功能的情况. string ...

  3. [Editor]Unity Editor类常用方法

    Editor文档资料 Unity教程之-Unity Attribute的使用总结:http://www.unity.5helpyou.com/3550.html 利用unity3d属性来设置Inspe ...

  4. unity -- Time类(持续更新中)

    2018年了,新年总是会制定很多具体目标和计划,不管能否坚持去完成,初衷和决心总是要有的.本年第一篇博客终于开始下笔了,先立一些今年和公司业务无关的的flag: 1.希望每月或两月能看一套蛮牛游戏上的 ...

  5. Unity Editor 编写unity插件类

    在unity写了一个编辑类,基于iTweenpath插件,为了更方便的操作iTweenpath,顺便练习UnityEditor的操作,写了一个CreateiTweenPath,放在Editor文件夹中 ...

  6. unity, 自定义类中使用print

    在unity脚本中自定义c#类,而且不继承MonoBehaviour的话,若还想在其中使用print函数,可以用MonoBehaviour.print(...).

  7. Unity 将一个类序列化并以 ".asset" 类型存储在 Resources 文件夹下

    概念: 序列化 (Serialization)将对象的状态信息转换为可以存储或传输的形式的过程.在序列化期间,对象将其当前状态写入到临时或持久性存储区.以后,可以通过从存储区中读取或反序列化对象的状态 ...

  8. Unity PlayerPrefs类进行扩展(整个对象进行保存)

    盘子脸在制作单机游戏的时候,先以为没有好多数据需要保存本地. 就没有使用json等格式自己进行保存. 使用PlayerPrefs类,但是后面字段越来越多的时候. PlayerPrefs保存就发现要手动 ...

  9. Unity Debug类

    静态变量 developerConsoleVisible 报告是否开发控制台是可见的.开发控制台不能出现使用: isDebugBuild 在构建设置对话框中有一个叫做"发展构建"复 ...

随机推荐

  1. PostgreSQL+PostGIS

    PostGIS简介 PostGIS是对象关系型数据库系统PostgreSQL的一个扩展,PostGIS提供如下空间信息服务功能:空间对象.空间索引.空间操作函数和空间操作符.同时,PostGIS遵循O ...

  2. spline interpolation and draw image by matplotlib

    1 # spline interpolation and draw image by matplotlib from scipy import interpolate import matplotli ...

  3. moment.js获取本周本月本年的开始日期和结束日期

    //获取本日 const startDate = moment().format('YYYY-MM-DD'); const startDate = moment().format('YYYY-MM-D ...

  4. iOS开发——AFNetworking基于https的使用

    应公司项目需求,之前的项目使用的http,新项目要求使用https,这篇博客是在AFNetworking框架基于http的基础上修改而来. 1.在开始前,先要把 .crt 文件转成 .cer 文件,然 ...

  5. canvas 连线曲线图

    <!DOCTYPE html><html><head> <meta charset="utf-8"> <meta name=& ...

  6. 学习《PythonWeb开发实战(董伟明)》中文PDF+源代码

    python可以用了进行数据分析,也可以进行Web开发,一般会使用django或者flask等进行开发. 国内介绍python web的书有写的不错的,推荐看看<PythonWeb开发实战> ...

  7. javaweb实现教师和教室管理系统 java jsp sqlserver

    1,程序设计思想 (1)设计三个类,分别是工具类(用来写连接数据库的方法和异常类的方法).信息类(用来写存储信息的方法).实现类(用来写各种操作数据库的方法) (2)定义两个jsp文件,一个用来写入数 ...

  8. caioj 1158 欧拉函数

    直接套模板,这道题貌似单独求还快一些 解法一 #include<cstdio> #include<cctype> #define REP(i, a, b) for(int i ...

  9. 别了WindowsXP

    生命中有太多的迎来送往,今日全世界都在告别它. 虽然自己已经在很久之前没有用XP系统了.告别它不如在一定意义上告别自己的一段时光... 2001年个人第一台电脑...初次安装XP,两张光盘一张安装盘一 ...

  10. Generator 简介

    Generator 就是一种状态机,封装多个内部状态. 执行 Generator 函数会返回一个遍历器对象(),也就是说,Generator 函数除了状态机,还是一个遍历器对象生成函数.返回的遍历器对 ...