From ac5421d899352ed1ff3b3fdb25c6b5ba5e383ad8 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Wed, 23 Apr 2025 10:01:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Editor/FixedMainEditor.cs | 24 +++ Assets/Scripts/Editor/TimerLock.cs | 11 ++ Assets/Scripts/Editor/TimerLock.cs.meta | 11 ++ Assets/Scripts/Editor/VirtualFPostProcess.cs | 32 +++- Assets/Scripts/Tools/ZXKLicenses.meta | 8 + .../Scripts/Tools/ZXKLicenses/Encryption.meta | 8 + .../ZXKLicenses/Encryption/DateManager.cs | 88 +++++++++ .../Encryption/DateManager.cs.meta | 11 ++ .../Encryption/DecryptFileReader.cs | 44 +++++ .../Encryption/DecryptFileReader.cs.meta | 11 ++ .../Encryption/EncryptFileCreator.cs | 56 ++++++ .../Encryption/EncryptFileCreator.cs.meta | 11 ++ .../Scripts/Tools/ZXKLicenses/HttpRestful.cs | 73 +++++++ .../Tools/ZXKLicenses/HttpRestful.cs.meta | 11 ++ Assets/Scripts/Tools/ZXKLicenses/Licence.meta | 8 + .../Tools/ZXKLicenses/Licence/LicenceData.cs | 46 +++++ .../ZXKLicenses/Licence/LicenceData.cs.meta | 11 ++ .../ZXKLicenses/Licence/LicenseManager.cs | 180 ++++++++++++++++++ .../Licence/LicenseManager.cs.meta | 11 ++ 19 files changed, 653 insertions(+), 2 deletions(-) create mode 100644 Assets/Scripts/Editor/TimerLock.cs create mode 100644 Assets/Scripts/Editor/TimerLock.cs.meta create mode 100644 Assets/Scripts/Tools/ZXKLicenses.meta create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Encryption.meta create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs.meta create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs.meta create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs.meta create mode 100644 Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs create mode 100644 Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs.meta create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Licence.meta create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs.meta create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs create mode 100644 Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs.meta diff --git a/Assets/Scripts/Editor/FixedMainEditor.cs b/Assets/Scripts/Editor/FixedMainEditor.cs index 44d2fa2c..568d4eee 100644 --- a/Assets/Scripts/Editor/FixedMainEditor.cs +++ b/Assets/Scripts/Editor/FixedMainEditor.cs @@ -1,3 +1,6 @@ +using QFramework; +using System; +using System.IO; using UnityEditor; using UnityEngine; @@ -31,5 +34,26 @@ public class FixedMainEditor Menu.SetChecked("Tools/ǿMain", isFixedMain); return true; } + + + + [MenuItem("Tools/ʱ")] + private static void TimerLock() + { + //Դļ + //Ǽ̳ScriptableObject + TimerLock asset = ScriptableObject.CreateInstance(); + //ǰһԴֻǴڴУҪ浽 + //ͨ༭APIһԴļڶΪԴļAssetsĿ¼µ· + AssetDatabase.CreateAsset(asset, "Assets/TimerLock.asset"); + //洴Դ + AssetDatabase.SaveAssets(); + //ˢ½ + AssetDatabase.Refresh(); + } + + + + } #endif \ No newline at end of file diff --git a/Assets/Scripts/Editor/TimerLock.cs b/Assets/Scripts/Editor/TimerLock.cs new file mode 100644 index 00000000..a7482a9f --- /dev/null +++ b/Assets/Scripts/Editor/TimerLock.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[CreateAssetMenu(fileName = "ʱ", menuName = "ʱ/ļ")] +public class TimerLock : ScriptableObject +{ + [Header("Ч")] + public string time; + +} diff --git a/Assets/Scripts/Editor/TimerLock.cs.meta b/Assets/Scripts/Editor/TimerLock.cs.meta new file mode 100644 index 00000000..d412f066 --- /dev/null +++ b/Assets/Scripts/Editor/TimerLock.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3fa014c2238b5a942b96b9f55a3f9841 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/VirtualFPostProcess.cs b/Assets/Scripts/Editor/VirtualFPostProcess.cs index a687e3f0..a6d39e6f 100644 --- a/Assets/Scripts/Editor/VirtualFPostProcess.cs +++ b/Assets/Scripts/Editor/VirtualFPostProcess.cs @@ -29,6 +29,34 @@ public class VirtualFPostProcess : IPostprocessBuildWithReport Debug.LogWarning("δҵĿ¼: " + dataFolderPath); } DeletAssetBundle(buildOutputPath); + + // ʱ + GneratorTimerLock(); + } + + /// + /// ʱļ + /// + public void GneratorTimerLock() + { + if (File.Exists(Application.dataPath + "/TimerLock.asset")) + { + string path = "Assets/TimerLock.asset"; + var asset = AssetDatabase.LoadAssetAtPath(path); + if (asset != null) + { + if (string.IsNullOrEmpty(asset.time) == false) + { + //һλȡȡϵͳʱ + DateTime currentDateTime = DateTime.Now; + string RecordData = currentDateTime.ToString("yyyy-MM-dd HH:mm:ss"); + string strMerge = asset.time + "|" + RecordData; + EncryptFileCreator.EncryptAndSaveData(strMerge, "Timer.txt"); + } + } + } + + } /// @@ -64,7 +92,7 @@ public class VirtualFPostProcess : IPostprocessBuildWithReport Debug.LogError($"Directory not found: {path}"); } } - else if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows|| EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows64) + else if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows || EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows64) { string path = Path.Combine(buildOutPutPath, "VirtualFramwork_Data", "StreamingAssets", "AssetBundles"); if (Directory.Exists(path)) @@ -92,7 +120,7 @@ public class VirtualFPostProcess : IPostprocessBuildWithReport Debug.LogError($"Directory not found: {path}"); } } - + } diff --git a/Assets/Scripts/Tools/ZXKLicenses.meta b/Assets/Scripts/Tools/ZXKLicenses.meta new file mode 100644 index 00000000..2dfa7e11 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4fec87e21a9630c46b1a6ef7dec72ea6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption.meta b/Assets/Scripts/Tools/ZXKLicenses/Encryption.meta new file mode 100644 index 00000000..65aade6d --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bb335401f53d3c94490f449b410da1ba +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs new file mode 100644 index 00000000..24f60bc0 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs @@ -0,0 +1,88 @@ +using System; +using System.IO; +using UnityEngine; +using UnityEngine.Events; + +public class DateManager : MonoBehaviour +{ + private string EndTimer;//结束时间 + private string RecordData; + private void Start() + { + UpdateTime(); + } + + /// + /// 更新系统时间 + /// + public void UpdateTime(UnityAction back1 = null, UnityAction back2 = null, UnityAction back3 = null) + { + try + { + string datas = DecryptFileReader.ReadAndDecryptData("Timer.txt"); + EndTimer = datas.Split('|')[0]; + RecordData = datas.Split('|')[1]; + //第一次获取获取系统时间 + DateTime currentDateTime = DateTime.Now; + string Data = currentDateTime.ToString("yyyy-MM-dd HH:mm:ss"); + if (DateTime.TryParse(RecordData, out DateTime recordDateTime) && DateTime.TryParse(Data, out DateTime nowDateTime)) + { + if (recordDateTime > nowDateTime) + { + Debug.Log("仿真文件被损坏,请联系管理员进行修复"); + back1?.Invoke(); + } + else + { + //把上一次存储得系统时间更新到最新 + string timer = "Timer.txt"; + RecordData = Data; + string strMerge = EndTimer + "|" + RecordData; + EncryptFileCreator.EncryptAndSaveData(strMerge, timer); + back3?.Invoke(); + } + } + } + catch (Exception e) + { + Debug.LogError($"数据出错: {e.Message}"); + back1?.Invoke(); + } + + if (JudgeExpire()) + { + Debug.Log("请联系管理员进行升级"); + back2?.Invoke(); + } + } + + /// + /// 判断是否到期 + /// + /// + public bool JudgeExpire() + { + if (DateTime.TryParse(EndTimer, out DateTime endDataTime) && DateTime.TryParse(RecordData, out DateTime recordDateTime)) + { + //结束日期小于目前日期代表到期 + if (endDataTime < recordDateTime) + { + return true; + } + } + return false; + } + + + /// + /// 给客户打包的时候,需要设置EndTimer,然后运行一次生成文件并注释掉 + /// + public void CreatTimer() + { + //第一次获取获取系统时间 + DateTime currentDateTime = DateTime.Now; + RecordData = currentDateTime.ToString("yyyy-MM-dd HH:mm:ss"); + string strMerge = EndTimer + "|" + RecordData; + EncryptFileCreator.EncryptAndSaveData(strMerge, "Timer.txt"); + } +} diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs.meta new file mode 100644 index 00000000..604aec1b --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 718cf7f3f1b16f141ab751a37af8cae1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs new file mode 100644 index 00000000..9a68c1bb --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs @@ -0,0 +1,44 @@ +using System.IO; +using System.Security.Cryptography; +using System.Text; +using UnityEngine; + +public class DecryptFileReader +{ + private static byte[] key = Encoding.UTF8.GetBytes("Sixteen byte key"); // 加密密钥,需与加密时一致 + private static byte[] iv = Encoding.UTF8.GetBytes("InitializationVe"); // 确保IV长度为16字节 + + public static string ReadAndDecryptData(string filePath) + { + string fullPath = Path.Combine(Application.streamingAssetsPath, filePath); + if (File.Exists(fullPath) == false) + { + return ""; + } + // 读取加密文件 + byte[] encryptedData = File.ReadAllBytes(fullPath); + + // 创建AES解密器 + using (Aes aesAlg = Aes.Create()) + { + aesAlg.Key = key; + aesAlg.IV = iv; + + ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV); + + // 创建内存流和加密流 + using (MemoryStream msDecrypt = new MemoryStream(encryptedData)) + { + using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) + { + byte[] decryptedBytes = new byte[encryptedData.Length]; + int decryptedByteCount = csDecrypt.Read(decryptedBytes, 0, decryptedBytes.Length); + + // 将解密后的数据转换为字符串 + string decryptedData = Encoding.UTF8.GetString(decryptedBytes, 0, decryptedByteCount); + return decryptedData; + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs.meta new file mode 100644 index 00000000..a4452c9b --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 354bc54210a77764ebad2d49b5e927ba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs b/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs new file mode 100644 index 00000000..e19b7f24 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs @@ -0,0 +1,56 @@ +using System.IO; +using System.Security.Cryptography; +using System.Text; +using UnityEngine; + +public class EncryptFileCreator +{ + private static byte[] key = Encoding.UTF8.GetBytes("Sixteen byte key"); // 加密密钥,需16字节 + private static byte[] iv = Encoding.UTF8.GetBytes("InitializationVe"); // 确保IV长度为16字节 + + public static void EncryptAndSaveData(string data,string path) + { + string filePath = Path.Combine(Application.streamingAssetsPath, path); + if (!File.Exists(filePath)) + { + try + { + // 创建文件 + File.WriteAllText(filePath, ""); + Debug.Log("文件已创建"); + } + catch (IOException e) + { + Debug.LogError($"创建文件时出错: {e.Message}"); + } + } + // 将数据转换为字节数组 + byte[] plainText = Encoding.UTF8.GetBytes(data); + + // 创建AES加密器 + using (Aes aesAlg = Aes.Create()) + { + aesAlg.Key = key; + aesAlg.IV = iv; + + ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV); + + // 创建内存流和加密流 + using (MemoryStream msEncrypt = new MemoryStream()) + { + using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write)) + { + csEncrypt.Write(plainText, 0, plainText.Length); + csEncrypt.FlushFinalBlock(); + + // 获取加密后的数据 + byte[] encryptedData = msEncrypt.ToArray(); + + // 保存加密文件到StreamingAssets文件夹 + string fullPath = Path.Combine(Application.streamingAssetsPath, filePath); + File.WriteAllBytes(fullPath, encryptedData); + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs.meta new file mode 100644 index 00000000..77d8e4b9 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 22f7660ba2e708d4eb33622fe324499b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs b/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs new file mode 100644 index 00000000..dd538b34 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs @@ -0,0 +1,73 @@ +using QFramework; +using System; +using System.Collections; +using UnityEngine; +using UnityEngine.Networking; + +public class HttpRestful : MonoSingleton +{ + public void Get(string url, Action actionResult = null) + { + StartCoroutine(_Get(url, actionResult)); + } + + private IEnumerator _Get(string url, Action action) + { + using (UnityWebRequest request = UnityWebRequest.Get(url)) + { + yield return request.SendWebRequest(); + + string resstr = ""; + if (request.isNetworkError || request.isHttpError) + { + resstr = request.error; + } + else + { + resstr = request.downloadHandler.text; + } + + if (action != null) + { + action(request.isHttpError, resstr); + } + } + } + public void Post(string url, string form, Action callBack, string Header = null, string HeaderValue = null, int timeOut = 3) + { + + StartCoroutine(_Post(url, form, callBack, Header, HeaderValue, timeOut)); + } + + public IEnumerator _Post(string url, string form, Action callBack, string Header = null, string HeaderValue = null, int timeOut = 3) + { + //请求链接,并将form对象发送到远程服务器 + using (UnityWebRequest webRequest = UnityWebRequest.Post(url, form, "application/json"))//;charset=utf-8 + { + if (!string.IsNullOrEmpty(Header) && !string.IsNullOrEmpty(HeaderValue)) + { + webRequest.SetRequestHeader(Header, HeaderValue); + } + webRequest.timeout = timeOut * 1000; + yield return webRequest.SendWebRequest(); + if (webRequest.result!= UnityWebRequest.Result.Success) + { + Debug.Log(webRequest.error); + callBack?.Invoke(false, webRequest.downloadHandler); + } + else + { + callBack?.Invoke(true, webRequest.downloadHandler); + } + //if (webRequest.isHttpError || webRequest.isNetworkError) + //{ + // //Debug.LogError("==========="); + // callBack?.Invoke(false, null); + //} + //else + //{ + // callBack?.Invoke(true, webRequest.downloadHandler); + //} + }; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs.meta new file mode 100644 index 00000000..2fa9020e --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cca16177d7a134a43a4fb3320d5b8fc7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Licence.meta b/Assets/Scripts/Tools/ZXKLicenses/Licence.meta new file mode 100644 index 00000000..a4c0b9c7 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Licence.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 32677377141e60248a7a2484825ce1d4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs new file mode 100644 index 00000000..d84ee2c5 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LicenceData +{ + public string project_id; + public string user_name; + public string license_code; + public string host_id; + public string duration; //使用时长 + public string sign; +} +public class Datas +{ + public static string Project_id = "7"; + public static string secretKey = "pZNwkYoMRp7MG_O7aGtmA"; + public static string UserName; + public static string Licensecode; + public static string Hostid; + public static int Duration;//持续时间 +} +[Serializable] +public class License +{ + public int id; + public string user_name; + public string license_code; + public int is_authorized; + public string host_id; + public string authorization_at; + public string authorization_end_at; + public string created_at; + public int login_count; + public int duration; + public string last_login; +} + +[Serializable] +public class LicenseValidationResponse +{ + public string status; + public string message; + public License license; +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs.meta new file mode 100644 index 00000000..de5c59a7 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f40d10c2dcbad941ac179b38fde96bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs new file mode 100644 index 00000000..0246d5db --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs @@ -0,0 +1,180 @@ +using Newtonsoft.Json; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Net.NetworkInformation; +using System.Security.Cryptography; +using System.Text; +using UnityEngine; + +public class LicenseManager : MonoBehaviour +{ + private Dictionary Data = new(); + private LicenseValidationResponse LicenseRes = new LicenseValidationResponse(); + private string Hostid = ""; + + public void Init() + { + Hostid = GetPhysicalAddress(); + Datas.Hostid = Hostid; + } + public LicenceData GetLicenceData(string projectid, string userName, string licensecode, string hostid, int duration) + { + Data.Clear(); + LicenceData licence = new LicenceData(); + licence.project_id = projectid; + licence.user_name = userName; + licence.license_code = licensecode; + licence.host_id = hostid; + licence.duration = duration.ToString(); + if (!Data.ContainsKey("project_id")) + { + Data.Add("project_id", licence.project_id); + } + if (!Data.ContainsKey("user_name")) + { + Data.Add("user_name", licence.user_name); + } + if (!Data.ContainsKey("license_code")) + { + Data.Add("license_code", licence.license_code); + } + if (!Data.ContainsKey("host_id")) + { + Data.Add("host_id", licence.host_id); + } + if (!Data.ContainsKey("duration")) + { + Data.Add("duration", licence.duration); + } + licence.sign = GenerateSignature(Datas.secretKey, Data); + return licence; + } + /// + /// 请求 + /// + /// + /// + public void LicensePost(Action callBack = null) + { + LicenceData licence = GetLicenceData(Datas.Project_id, Datas.UserName, Datas.Licensecode, Datas.Hostid, Datas.Duration); + + string json = JsonConvert.SerializeObject(licence); + HttpRestful.Instance.Post("https://locallicense.zxkedu.com/api/license/validate/", json, (m, n) => + { + JsonConvert.DeserializeObject(n.text); + if (LicenseRes.status == "success") + { + EncryptedFile(); + } + callBack.Invoke(m); + }); + } + + /// + /// 生成密匙 + /// + /// + /// + /// + public string GenerateSignature(string secretKey, Dictionary data) + { + // 添加当前时间戳 + //string timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(); + //获取当前时间戳并四舍五入到最近的分钟 + long timestamp = (long)(DateTimeOffset.UtcNow.ToUnixTimeSeconds() / 60) * 60; + //long timestamp = (long)(GetTimestamp() / 60) * 60; + if (!data.ContainsKey("timestamp")) + { + data.Add("timestamp", timestamp.ToString()); + } + else + { + data["timestamp"] = timestamp.ToString(); + } + // 对键值对进行排序 + var sortedData = data.OrderBy(kvp => kvp.Key); + Debug.Log("sortedData对键值对进行排序:" + sortedData); + + // 构建查询字符串 + string queryString = string.Join("&", sortedData.Select(kvp => $"{kvp.Key}={kvp.Value}")); + Debug.Log("queryString构建查询字符串:" + queryString); + // 使用HMAC-SHA256生成签名 + using (var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secretKey))) + { + byte[] hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(queryString)); + Debug.Log("生成签名:" + BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant()); + return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant(); + } + } + + public void StartSetDuration() + { + if (gameObject.activeSelf) + { + StartCoroutine(SetDuration(60f)); + } + } + + IEnumerator SetDuration(float times) + { + while (true) + { + yield return new WaitForSeconds(times); + Datas.Duration++; + LicensePost(); + Datas.Duration = 0; + } + } + public string GetMachineGuid() + { + if (string.IsNullOrEmpty(Hostid)) + { + NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces(); + foreach (NetworkInterface ni in nis) + { + if (ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || + ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet) + { + Hostid = ni.GetPhysicalAddress().ToString(); + break; + } + } + } + return Hostid; + } + + string GetPhysicalAddress() + { + //string physicalAddress = ""; + //NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces(); + //foreach (NetworkInterface ni in nis) + //{ + // if (ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet && ni.OperationalStatus == OperationalStatus.Up) + // { + // physicalAddress = ni.GetPhysicalAddress().ToString(); + // break; + // } + //} + return SystemInfo.deviceUniqueIdentifier; + } + + /// + /// 本地存储Hostid + /// + public void EncryptedFile() + { + string dataToEncrypt = Datas.UserName + "|" + Datas.Licensecode + "|"; + EncryptFileCreator.EncryptAndSaveData(dataToEncrypt, "encryptedData.txt"); + } + /// + /// 读取Hostid + /// + /// + public string ReadDecryptedFile() + { + string decryptedData = DecryptFileReader.ReadAndDecryptData("encryptedData.txt"); + return decryptedData; + } +} diff --git a/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs.meta new file mode 100644 index 00000000..b85899a3 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13a2f840c2d90a44b8473ca7cf9adef1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From c9f3add8a353104518f0495eb36ed9796193acb8 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Wed, 23 Apr 2025 10:12:42 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scenes/Main.unity | 850 ++++++++++++++++++ .../ZXKLicenses/Encryption/DateManager.cs | 30 +- 2 files changed, 874 insertions(+), 6 deletions(-) diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 4e3c1859..8f07b9aa 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -765,6 +765,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 376402498555991245} + - {fileID: 2066511179} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -939,6 +940,54 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &2066511178 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2066511179} + - component: {fileID: 2066511180} + m_Layer: 0 + m_Name: UIDateCheck + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2066511179 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2066511178} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -960, y: -540, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 888371916723674439} + m_Father: {fileID: 1269024859} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2066511180 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2066511178} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 718cf7f3f1b16f141ab751a37af8cae1, type: 3} + m_Name: + m_EditorClassIdentifier: + ui: {fileID: 2089839050043354719} + text: {fileID: 4601331229292980818} + btn: {fileID: 7231834583498103603} --- !u!1 &2114935602 GameObject: m_ObjectHideFlags: 0 @@ -1098,6 +1147,40 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7258947687994042621} m_CullTransparentMesh: 1 +--- !u!114 &110887888300473105 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3921544984887548570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: 436 + m_MinHeight: 43 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!114 &187303085634958717 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 2 + m_VerticalFit: 2 --- !u!224 &376402498555991245 RectTransform: m_ObjectHideFlags: 0 @@ -1118,6 +1201,34 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &457648689321205319 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: 436 + m_MinHeight: 183 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!222 &525492089466544073 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5681206649821475691} + m_CullTransparentMesh: 1 --- !u!114 &755439116886819988 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1148,6 +1259,26 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!224 &888371916723674439 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2089839050043354719} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7622962939547687553} + m_Father: {fileID: 2066511179} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &902241654539185805 RectTransform: m_ObjectHideFlags: 0 @@ -1189,6 +1320,36 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 238, y: 176} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1128038912698321512 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7245332692720103295} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.5019608} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!114 &1504961720473882854 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1205,6 +1366,56 @@ MonoBehaviour: CustomComponentName: Icon CustomComment: mComponentName: UnityEngine.UI.Image +--- !u!1 &1671880619992264758 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2521152647019992497} + - component: {fileID: 6681216128200013423} + - component: {fileID: 1813275364079888314} + - component: {fileID: 7231834583498103603} + - component: {fileID: 6180712463440446537} + m_Layer: 5 + m_Name: BtnPrefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1813275364079888314 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1671880619992264758} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: fa63ae52e51e2064390c2a75c12f664c, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!114 &1982103501701676502 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1313,6 +1524,93 @@ MonoBehaviour: optionalScrambleMode: 0 optionalShakeRandomnessMode: 0 optionalString: +--- !u!222 &1988465934601991813 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7245332692720103295} + m_CullTransparentMesh: 1 +--- !u!1 &2086965462285735655 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3877370567018537602} + - component: {fileID: 4239072621578749216} + - component: {fileID: 7937913353350945267} + - component: {fileID: 2814462432456552503} + - component: {fileID: 187303085634958717} + - component: {fileID: 457648689321205319} + m_Layer: 5 + m_Name: Connnet + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &2089839050043354719 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 888371916723674439} + - component: {fileID: 7923541361196308593} + - component: {fileID: 4452057681510801829} + m_Layer: 5 + m_Name: UITipWindow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2521152647019992497 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1671880619992264758} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6623231731764336771} + m_Father: {fileID: 2655579637452759910} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 128.1478, y: 41.656} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &2655579637452759910 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4656565024652926694} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2521152647019992497} + m_Father: {fileID: 3877370567018537602} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2802739808984475110 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1321,6 +1619,155 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7740213339686398260} m_CullTransparentMesh: 1 +--- !u!114 &2814462432456552503 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 20 + m_Right: 20 + m_Top: 20 + m_Bottom: 0 + m_ChildAlignment: 1 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 + m_ChildScaleWidth: 1 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!114 &3325917066968789983 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5681206649821475691} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u786E\u5B9A" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 16 + m_fontSizeBase: 16 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 8192 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!114 &3425016141668694121 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4656565024652926694} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 15 + m_ChildAlignment: 4 + m_Spacing: 22 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!222 &3576997835000597077 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3921544984887548570} + m_CullTransparentMesh: 1 --- !u!1 &3604560447573429497 GameObject: m_ObjectHideFlags: 0 @@ -1350,6 +1797,71 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cabec804a45ce1941b8c1895f35d2860, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &3841773505581629585 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3921544984887548570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: Label + CustomComment: + mComponentName: TMPro.TextMeshProUGUI +--- !u!224 &3877370567018537602 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6349304297074725759} + - {fileID: 2655579637452759910} + m_Father: {fileID: 7622962939547687553} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 91.49997} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.99999994} +--- !u!1 &3921544984887548570 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6349304297074725759} + - component: {fileID: 3576997835000597077} + - component: {fileID: 4601331229292980818} + - component: {fileID: 110887888300473105} + - component: {fileID: 3841773505581629585} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &4239072621578749216 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + m_CullTransparentMesh: 1 --- !u!222 &4329888169046837703 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1358,6 +1870,37 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5754390454264469586} m_CullTransparentMesh: 1 +--- !u!114 &4444983099252657014 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4656565024652926694} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: BtnContent + CustomComment: + mComponentName: RectTransform +--- !u!114 &4452057681510801829 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2089839050043354719} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cadc477eb7be81c4b899b49b072235bd, type: 3} + m_Name: + m_EditorClassIdentifier: + Label: {fileID: 4601331229292980818} + BtnContent: {fileID: 2655579637452759910} + BtnPrefab: {fileID: 7231834583498103603} --- !u!114 &4467067367704618080 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1374,6 +1917,113 @@ MonoBehaviour: CustomComponentName: Label CustomComment: mComponentName: TMPro.TextMeshProUGUI +--- !u!114 &4601331229292980818 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3921544984887548570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u662F\u5426\u9000\u51FA\u5F53\u524D\u6A21\u5757\uFF1F" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 20 + m_fontSizeBase: 20 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &4656565024652926694 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2655579637452759910} + - component: {fileID: 3425016141668694121} + - component: {fileID: 4444983099252657014} + m_Layer: 5 + m_Name: BtnContent + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!224 &5548267066476286416 RectTransform: m_ObjectHideFlags: 0 @@ -1393,6 +2043,24 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 25} m_SizeDelta: {x: 0, y: 50} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &5681206649821475691 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6623231731764336771} + - component: {fileID: 525492089466544073} + - component: {fileID: 3325917066968789983} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &5754390454264469586 GameObject: m_ObjectHideFlags: 0 @@ -1430,6 +2098,68 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!114 &6180712463440446537 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1671880619992264758} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: BtnPrefab + CustomComment: + mComponentName: UnityEngine.UI.Button +--- !u!224 &6349304297074725759 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3921544984887548570} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3877370567018537602} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &6623231731764336771 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5681206649821475691} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2521152647019992497} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6681216128200013423 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1671880619992264758} + m_CullTransparentMesh: 1 --- !u!114 &6979315384717970559 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1468,6 +2198,68 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5773262138564131193} m_CullTransparentMesh: 1 +--- !u!114 &7231834583498103603 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1671880619992264758} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 2 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 21300000, guid: 8c77a2052664d0d4e9be892444deddd1, type: 3} + m_SelectedSprite: {fileID: 21300000, guid: 8c77a2052664d0d4e9be892444deddd1, type: 3} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1813275364079888314} + m_OnClick: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &7245332692720103295 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7622962939547687553} + - component: {fileID: 1988465934601991813} + - component: {fileID: 1128038912698321512} + m_Layer: 5 + m_Name: Mask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &7258947687994042621 GameObject: m_ObjectHideFlags: 0 @@ -1486,6 +2278,26 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!224 &7622962939547687553 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7245332692720103295} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3877370567018537602} + m_Father: {fileID: 888371916723674439} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &7740213339686398260 GameObject: m_ObjectHideFlags: 0 @@ -1525,6 +2337,44 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 23.5} m_SizeDelta: {x: 51, y: 51} m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7923541361196308593 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2089839050043354719} + m_CullTransparentMesh: 1 +--- !u!114 &7937913353350945267 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 003fddd8e0543224fb849ccdbb422cd6, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!114 &8704027912026391313 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs index 24f60bc0..0633c317 100644 --- a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs @@ -1,21 +1,39 @@ using System; using System.IO; +using TMPro; using UnityEngine; using UnityEngine.Events; +using UnityEngine.UI; public class DateManager : MonoBehaviour { private string EndTimer;//结束时间 private string RecordData; + public GameObject ui; + public TextMeshProUGUI text; + public Button btn; + private void Awake() + { + btn.onClick.AddListener(() => + { + Application.Quit(); + }); + UpdateTime(ShowTip, ShowTip); + } private void Start() { - UpdateTime(); + } + + public void ShowTip(string str) + { + ui.SetActive(true); + text.text = str; } /// /// 更新系统时间 /// - public void UpdateTime(UnityAction back1 = null, UnityAction back2 = null, UnityAction back3 = null) + public void UpdateTime(UnityAction error = null, UnityAction timeOut = null, UnityAction updateTimer = null) { try { @@ -30,7 +48,7 @@ public class DateManager : MonoBehaviour if (recordDateTime > nowDateTime) { Debug.Log("仿真文件被损坏,请联系管理员进行修复"); - back1?.Invoke(); + error?.Invoke("仿真文件被损坏,请联系管理员进行修复"); } else { @@ -39,20 +57,20 @@ public class DateManager : MonoBehaviour RecordData = Data; string strMerge = EndTimer + "|" + RecordData; EncryptFileCreator.EncryptAndSaveData(strMerge, timer); - back3?.Invoke(); + updateTimer?.Invoke(); } } } catch (Exception e) { Debug.LogError($"数据出错: {e.Message}"); - back1?.Invoke(); + error?.Invoke($"数据出错: {e.Message}"); } if (JudgeExpire()) { Debug.Log("请联系管理员进行升级"); - back2?.Invoke(); + timeOut?.Invoke("请联系管理员进行升级"); } } From 4ce0b3e9cb46ad00a023780482fbad2430400597 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Wed, 23 Apr 2025 10:15:28 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs index 0633c317..97a8c72c 100644 --- a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs @@ -14,15 +14,13 @@ public class DateManager : MonoBehaviour public Button btn; private void Awake() { + ui.gameObject.SetActive(false); btn.onClick.AddListener(() => { Application.Quit(); }); UpdateTime(ShowTip, ShowTip); } - private void Start() - { - } public void ShowTip(string str) { From fcdbf4c29cd08befa61fa9b7622debc1f33ebfef Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Wed, 23 Apr 2025 10:18:30 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scenes/Main.unity | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 8f07b9aa..5790e9e2 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -750,7 +750,7 @@ Canvas: m_AdditionalShaderChannelsFlag: 25 m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 - m_SortingOrder: 0 + m_SortingOrder: 500 m_TargetDisplay: 0 --- !u!224 &1269024859 RectTransform: @@ -765,7 +765,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 376402498555991245} - - {fileID: 2066511179} + - {fileID: 1764640267} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -940,7 +940,7 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &2066511178 +--- !u!1 &1764640266 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -948,8 +948,8 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 2066511179} - - component: {fileID: 2066511180} + - component: {fileID: 1764640267} + - component: {fileID: 1764640268} m_Layer: 0 m_Name: UIDateCheck m_TagString: Untagged @@ -957,29 +957,33 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &2066511179 -Transform: +--- !u!224 &1764640267 +RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2066511178} - serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -960, y: -540, z: 0} + m_GameObject: {fileID: 1764640266} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 888371916723674439} m_Father: {fileID: 1269024859} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &2066511180 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1764640268 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2066511178} + m_GameObject: {fileID: 1764640266} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 718cf7f3f1b16f141ab751a37af8cae1, type: 3} @@ -1266,18 +1270,18 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2089839050043354719} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 7622962939547687553} - m_Father: {fileID: 2066511179} + m_Father: {fileID: 1764640267} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: -1920, y: -1080} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &902241654539185805 RectTransform: