System Info 정보 확인(배터리잔량, 장치 모델, 그래픽카드,운영체제등등)
시스템 및 하드웨어 정보에 액세스한다.
기본적으로 플랫폼의 정보와 하드웨어의 기능을 알수있다.
배터리 잔량, 장치모델, 그래픽카드, 운영체제, 랜더링정보 등등 여러가지 정보를 제공해준다.
반응형
간단하게 해당 SystemInfo를 GUI를 이용해서 처리하는 코드이다.
using UnityEngine;
using System.Reflection;
public class SystemInfoLog : MonoBehaviour
{
private GUIStyle textStyle;
private Vector2 scroll;
void Start()
{
textStyle = new GUIStyle();
textStyle.normal.textColor = Color.white;
textStyle.fontSize = 12;
}
void OnGUI()
{
scroll = GUILayout.BeginScrollView(scroll, GUILayout.Width(Screen.width),
GUILayout.Height(Screen.height)); System.Type targetType = typeof(SystemInfo);
PropertyInfo[] propertyInfoes = targetType.GetProperties();
foreach (PropertyInfo p in propertyInfoes)
GUILayout.Label($"{p.Name}: {p.GetValue(null, null)}", textStyle);
GUILayout.EndScrollView();
}
}
Unity SystemInfo : [ 링크 ]
★☆☆☆☆
반응형
댓글