45 lines
No EOL
1.3 KiB
C#
45 lines
No EOL
1.3 KiB
C#
// Assets/ShiroginSDK/Runtime/Data/DeviceData.cs
|
|
|
|
using System;
|
|
using UnityEngine;
|
|
|
|
namespace ShiroginSDK.Runtime.Modules.Data.Scripts
|
|
{
|
|
[Serializable]
|
|
public class DeviceData : BaseData
|
|
{
|
|
public string DeviceModel;
|
|
public string OperatingSystem;
|
|
public string CpuType;
|
|
public int SystemMemoryMB;
|
|
public string GpuName;
|
|
public int ScreenWidth;
|
|
public int ScreenHeight;
|
|
public int RefreshRate;
|
|
public string AppVersion;
|
|
public string BundleId;
|
|
protected override string PrefsKey => "DEVICE_DATA";
|
|
|
|
public void RefreshFromSystem()
|
|
{
|
|
DeviceModel = SystemInfo.deviceModel;
|
|
OperatingSystem = SystemInfo.operatingSystem;
|
|
CpuType = SystemInfo.processorType;
|
|
SystemMemoryMB = SystemInfo.systemMemorySize;
|
|
GpuName = SystemInfo.graphicsDeviceName;
|
|
|
|
ScreenWidth = Screen.width;
|
|
ScreenHeight = Screen.height;
|
|
RefreshRate = (int)Screen.currentResolution.refreshRateRatio.value;
|
|
|
|
#if UNITY_6000_0_OR_NEWER
|
|
AppVersion = Application.version;
|
|
#else
|
|
AppVersion = Application.version;
|
|
#endif
|
|
BundleId = Application.identifier;
|
|
|
|
Save();
|
|
}
|
|
}
|
|
} |