ãUnityãUnityã§ç«¯æ«ã®æ å ±(OS, æ©ç¨®å, ã¡ã¢ãªãµã¤ãºãªã©)ãåå¾ããï¼
ä»åã¯ãç¾å¨ã¢ããªã«ä½¿ããã¦ãã端æ«æ
å ±ãUnityå´ã§åå¾ãããã¨æãã¾ãï¼
ä¾ãã°ãåãåãããã©ã¼ã ãã¢ããªå
ã«ä½ãå ´åã
OS(iOS 10.2ãªã©)ããæ©ç¨®å(iPhone7Plusãªã©)ã®æ
å ±ãä¸ç·ã«åãåããã°ããã°ãã£ãã¯ã¹ã®å½¹ã«ç«ã¡ã¾ãããï¼
Unityã§ç«¯æ«ã®æ å ±(OS, æ©ç¨®å, ã¡ã¢ãªãµã¤ãºãªã©)ãåå¾ããï¼
端æ«æ
å ±ã®åå¾ã«ã¯ãUnityæ¨æºã®SystemInfoã¯ã©ã¹ã使ãã¾ãã
以ä¸ã½ã¼ã¹ã§ãã
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class DeviceInfo : MonoBehaviour { [SerializeField] Text text; void Start () { text.text = ""; Dictionary<string, string> systemInfo = new Dictionary<string, string>(); systemInfo.Add("ã¦ãã¼ã¯ID", SystemInfo.deviceUniqueIdentifier); systemInfo.Add("OSæ å ±", SystemInfo.operatingSystem); systemInfo.Add("CPUæ å ±", SystemInfo.processorType); systemInfo.Add("ã¡ã¢ãªæ å ±", SystemInfo.systemMemorySize.ToString()); #if UNITY_IPHONE systemInfo.Add("iPhoneã¢ãã«å", UnityEngine.iOS.Device.generation.ToString()); #endif systemInfo.Add("ã¢ãã«å", SystemInfo.deviceModel); systemInfo.Add("端æ«å", SystemInfo.deviceName); systemInfo.Add("端æ«ã¿ã¤ã", SystemInfo.deviceType.ToString()); foreach (string key in systemInfo.Keys) { text.text += key + " = " + systemInfo[key]+"\n"; } } }
DeviceInfo.cs
ã¯ããã«Dictionaryåã®å¤æ°ãä½æããããã«ã©ãã©ãæ
å ±ãAddãã¦ããã¾ãï¼
æå¾ã«uGUIã®Textã«å
¨æ
å ±ãæ¸ãè¾¼ã¿ãç»é¢ã«è¡¨ç¤ºãã¦ãã¾ãï¼
SystemInfoã¯ã©ã¹ã使ãã°ç°¡åã«ç«¯æ«æ
å ±ãåå¾ã§ãã¾ãã®ã§ããã²ä½¿ã£ã¦ã¿ã¦ä¸ããã
ä»åã¯ä»¥ä¸ã«ãªãã¾ãã