diff --git a/Runtime/Utils.cs b/Runtime/Utils.cs index 528bef3..a6028fd 100644 --- a/Runtime/Utils.cs +++ b/Runtime/Utils.cs @@ -27,5 +27,22 @@ namespace UltraCombos.Frozen.RoyalGallery string hex = color.r.ToString("X2") + color.g.ToString("X2") + color.b.ToString("X2"); return hex; } + + public static string GenerateSerial(int dev_id, string page_id) + { + string dev_sid = dev_id.ToString("X"); + string date = System.DateTime.Now.ToString("HHmmss"); + string res_sid = page_id; + try + { + res_sid = System.Int32.Parse(res_sid).ToString("X"); + } + catch (System.FormatException) + { + Debug.LogWarning($"GenerateSerial: rid={res_sid} is not number."); + } + + return $"{date}{dev_sid}{res_sid}"; + } } }