unity SystemInfo类 获得电量battery
我觉得用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的更多相关文章
- Unity 改变类模板-为你的类添加一个命名空间
之前在写代码的时候,就很疑惑为什么创建类的时候.没有命名空间呢? 后来自己的类终于和别人写的类名字有冲突.... 如何修改Unity创建类的模板呢? 找到下面这个文件 然后修改 保存文件在Uni ...
- Unity3D的SystemInfo类,用于获取运行设备硬件信息(CPU、显卡、类型等)
SystemInfo类中的静态变量: 中文显示: Rendering.CopyTextureSupport copyTextureSupport:(只读)支持多种复制纹理功能的情况. string ...
- [Editor]Unity Editor类常用方法
Editor文档资料 Unity教程之-Unity Attribute的使用总结:http://www.unity.5helpyou.com/3550.html 利用unity3d属性来设置Inspe ...
- unity -- Time类(持续更新中)
2018年了,新年总是会制定很多具体目标和计划,不管能否坚持去完成,初衷和决心总是要有的.本年第一篇博客终于开始下笔了,先立一些今年和公司业务无关的的flag: 1.希望每月或两月能看一套蛮牛游戏上的 ...
- Unity Editor 编写unity插件类
在unity写了一个编辑类,基于iTweenpath插件,为了更方便的操作iTweenpath,顺便练习UnityEditor的操作,写了一个CreateiTweenPath,放在Editor文件夹中 ...
- unity, 自定义类中使用print
在unity脚本中自定义c#类,而且不继承MonoBehaviour的话,若还想在其中使用print函数,可以用MonoBehaviour.print(...).
- Unity 将一个类序列化并以 ".asset" 类型存储在 Resources 文件夹下
概念: 序列化 (Serialization)将对象的状态信息转换为可以存储或传输的形式的过程.在序列化期间,对象将其当前状态写入到临时或持久性存储区.以后,可以通过从存储区中读取或反序列化对象的状态 ...
- Unity PlayerPrefs类进行扩展(整个对象进行保存)
盘子脸在制作单机游戏的时候,先以为没有好多数据需要保存本地. 就没有使用json等格式自己进行保存. 使用PlayerPrefs类,但是后面字段越来越多的时候. PlayerPrefs保存就发现要手动 ...
- Unity Debug类
静态变量 developerConsoleVisible 报告是否开发控制台是可见的.开发控制台不能出现使用: isDebugBuild 在构建设置对话框中有一个叫做"发展构建"复 ...
随机推荐
- AndroidStudio EventBus报错解决方法its super classes have no public methods with the @Subscribe
首先说明,以前我用eventBus的jar包写得项目demo,前几天就写了一个EventBus的实例,这次我没用jar包,直接用gradle引用的,可是demo写完了,报错: its super cl ...
- Sublime Text 3 注册码 激活码 版本号 Build 3143
—– BEGIN LICENSE —– TwitterInc 200 User License EA7E-890007 1D77F72E 390CDD93 4DCBA022 FAF60790 61AA ...
- shell-3.bash的基本功能:通配符和其他特殊字符
1. 2.
- NetworkX-simple graph
import networkx as nx import matplotlib.pyplot import scipy.io as sio import numpy as np load_path=' ...
- Servicification
Servicification Summary The Chromium codebase now supports many platforms and use cases. In response ...
- Quartz任务调度 服务日志+log4net打印日志+制作windows服务
引言 现在许多的项目都需要定时的服务进行支撑,而我们经常用到的定时服务就是Quartz任务调度了.不过我们在使用定时Job进行获取的时候,有时候我们就需要记录一下自定义的日志,甚至我们还会对执行定时J ...
- HDU-4221 Greedy? 贪心 从元素的相对位置开始考虑
题目链接:https://cn.vjudge.net/problem/HDU-4221 题意 给n个活动,每个活动需要一段时间C来完成,并且有一个截止时间D 当完成时间t大于截止时间完成时,会扣除t- ...
- [USACO17DEC]Milk Measurement(平衡树)
题意 最初,农夫约翰的每头奶牛每天生产G加仑的牛奶 (1≤G≤109)(1≤G≤10^9)(1≤G≤109) .由于随着时间的推移,奶牛的产奶量可能会发生变化,农夫约翰决定定期对奶牛的产奶量进行测量, ...
- 浅谈 MySQL的外键的作用
MySQL中外键的介绍: MySQL外键必须使用存储引擎为 innDB 其中MySAM 和MEMORYH这两种引擎不支持 由数据库自身保证数据一致性,完整性,更可靠,因为程序很难100%保证数据的 ...
- 改造vue-quill-editor: 结合element-ui上传图片到服务器
前排提示:现在可以直接使用封装好的插件vue-quill-editor-upload 需求概述 vue-quill-editor是我们再使用vue框架的时候常用的一个富文本编辑器,在进行富文本编辑的时 ...