| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- namespace UnityCommon
- {
- public class InputPanel : MonoBehaviour
- {
- private bool visible;
- public bool Visible
- {
- get { return visible; }
- set
- {
- gameObject.SetActive(value);
- visible = value;
- if (visible)
- {
- SetInfo();
- }
- }
- }
- public Text textInfo;
- private string mac;
- public void SetInfo()
- {
- mac = SystemInfo.deviceUniqueIdentifier;
- GUIUtility.systemCopyBuffer = mac;
- textInfo.text = $"该主机未注册,请联系管理员注册。机器码已复制到粘贴板:{mac}";
- }
- public InputField inputField;
- public void OnClickQuit()
- {
- Application.Quit();
- }
- public void OnClickReg()
- {
- var regMd5 = Utility.GetMD5WithString(mac + "swsj202312");
- if (regMd5 != inputField.text)
- {
- textInfo.text = "注册码无效...";
- }
- else
- {
- PlayerPrefs.SetString("RegistrationCode", regMd5);
- textInfo.text = "注册成功!请重启软件。";
- }
- }
- }
- }
|