Files
AIGame/AIClient/Assets/HotUpdate/Scripts/Net/DeviceId.cs
T
udxandCursor b7a0bbcb89 Add hot-update boot pipeline, UI bundles/atlas assets, and design docs.
Ignore AIClient/Library and AIClient/HybridCLRData permanently; include HybridCLR/YooAsset project setup and UI tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 16:02:58 +08:00

23 lines
523 B
C#

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;
}
}
}