using System; using UnityEngine; namespace HotUpdate.Net { public static class DeviceId { const string PrefKey = "aigame.device_id"; public static string GetOrCreate() { var id = PlayerPrefs.GetString(PrefKey, string.Empty); if (!string.IsNullOrEmpty(id)) return id; id = $"ed_{Guid.NewGuid():N}".Substring(0, 18); PlayerPrefs.SetString(PrefKey, id); PlayerPrefs.Save(); return id; } } }