728x90
반응형
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using System;
using System.Text;
public class SystemInfomation : MonoBehaviour
{
public Text m_SystemInfomation;
private StringBuilder m_Message = new StringBuilder();
[SerializeField] private string m_OperatingSystem;
[SerializeField] private string m_DeviceModel;
[SerializeField] private string m_ProcessorType;
[SerializeField] private int m_ProcessorCount;
[SerializeField] private float m_SystemMemorySize;
[SerializeField] private float m_GcTotalMemory;
[SerializeField] private RuntimePlatform m_Platform;
[SerializeField] private string m_ApplicationVersion;
[SerializeField] private SystemLanguage m_SystemLanguage;
[SerializeField] private int m_Width;
[SerializeField] private int m_Height;
[SerializeField] private float m_PlayTime;
[SerializeField] private float m_LevelPlayTime;
[SerializeField] private string m_LevelName;
[SerializeField] private bool m_SupportsLocationService;
[SerializeField] private bool m_SupportsAccelerometer;
[SerializeField] private bool m_SupportsGyroscope;
[SerializeField] private bool m_SupportsVibration;
[SerializeField] private bool m_SupportsAudio;
[SerializeField] private string m_GraphicsDeviceName;
[SerializeField] private string m_GraphicsDeviceVersion;
[SerializeField] private float m_GraphicsMemorySize;
[SerializeField] private int m_MaxTextureSize;
[SerializeField] private NPOTSupport m_NpotSupport;
public static float m_CpuUsage;
void Update()
{
GetSystemInformation();
Log();
}
private void GetSystemInformation()
{
m_OperatingSystem = SystemInfo.operatingSystem;
m_DeviceModel = SystemInfo.deviceModel;
m_ProcessorType = SystemInfo.processorType;
m_ProcessorCount = SystemInfo.processorCount;
m_SystemMemorySize = (float)(SystemInfo.systemMemorySize) / 1024;
m_GcTotalMemory = ((float)GC.GetTotalMemory(false)) / 1024 / 1024;
m_Platform = Application.platform;
m_ApplicationVersion = Application.version;
m_SystemLanguage = Application.systemLanguage;
m_Width = Screen.width;
m_Height = Screen.height;
m_PlayTime = Time.unscaledTime;
m_LevelPlayTime = Time.timeSinceLevelLoad;
m_LevelName = SceneManager.GetActiveScene().name;
m_SupportsLocationService = SystemInfo.supportsLocationService;
m_SupportsAccelerometer = SystemInfo.supportsAccelerometer;
m_SupportsGyroscope = SystemInfo.supportsGyroscope;
m_SupportsVibration = SystemInfo.supportsVibration;
m_SupportsAudio = SystemInfo.supportsAudio;
m_GraphicsDeviceName = SystemInfo.graphicsDeviceName;
m_GraphicsDeviceVersion = SystemInfo.graphicsDeviceVersion;
m_GraphicsMemorySize = (float)SystemInfo.graphicsMemorySize / 1024;
m_MaxTextureSize = SystemInfo.maxTextureSize;
m_NpotSupport = SystemInfo.npotSupport;
}
private void Log()
{
if (m_SystemInfomation != null)
{
m_Message.Clear();
m_Message.Append(
"[시스템]\n" +
"운영 체제 : " + m_OperatingSystem + "\n" +
"장치 모델 : " + m_DeviceModel + "\n" +
"프로세서 이름 : " + m_ProcessorType + "\n" +
"프로세서 개수 : " + m_ProcessorCount + "\n" +
"메모리 크기 : " + m_SystemMemorySize + "GB\n" +
"가비지 컬렉션 크기 : " + m_GcTotalMemory + "MB\n" +
"\n[그래픽]\n" +
"그래픽 카드 이름 : " + m_GraphicsDeviceName + "\n" +
"그래픽 카드 드라이버 버전 : " + m_GraphicsDeviceVersion + "\n" +
"그래픽 메모리 크기 : " + m_GraphicsMemorySize + " GB\n" +
"최대 텍스처 크기 : " + m_MaxTextureSize + "\n" +
"NPOT : " + m_NpotSupport + "\n" + // None, Restricted, Full
"\n[기능]\n" +
"위치 서비스 지원 : " + m_SupportsLocationService + "\n" +
"장치 가속도계 지원 : " + m_SupportsAccelerometer + "\n" +
"자이로스코프 지원 : " + m_SupportsGyroscope + "\n" +
"진동 지원 : " + m_SupportsVibration + "\n" +
"오디오 지원 : " + m_SupportsAudio + "\n" +
"\n[응용 프로그램]\n" +
"플랫폼 : " + m_Platform + "\n" +
"버전 : " + m_ApplicationVersion + "\n" +
"시스템 언어 : " + m_SystemLanguage + "\n" +
"\n[디스플레이]\n" +
"해상도 : " + m_Width + " x " + m_Height + "\n" +
"\n[실행]\n" +
"현재 씬 이름 : " + m_LevelName + "\n" +
"전체 실행 시간 : " + m_PlayTime + "\n" +
"현재 씬 실행 시간 : " + m_LevelPlayTime + "\n");
m_SystemInfomation.text = m_Message.ToString();
}
}
}
728x90
반응형
'프로그램 > 유니티 스크립트 소스' 카테고리의 다른 글
[유니티 스크립트 소스] Fish Flock (0) | 2021.02.02 |
---|---|
[유니티 스크립트 소스] Excel (3) | 2021.02.02 |
[유니티 스크립트 소스] 화면 캡처 png, jpg, tga, exr 파일로 저장 (0) | 2020.05.08 |
[유니티 스크립트 소스] 배열에서 최소값, 최소값 얻기 (0) | 2020.04.14 |
[유니티 스크립트 소스] 마우스(Mouse) 관련 (0) | 2020.03.24 |