GetAndroidSNIEMI.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class GetAndroidSNIEMI : MonoBehaviour
  6. {
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. //AndroidJavaObject tm = new AndroidJavaObject("android.telephony.TelephonyManager");
  11. //string imei = tm.Call<string>("getDeviceId");
  12. //Debug.Log("IMEI: " + imei);
  13. // UILogManager.Instance.text3.text += tm;
  14. //AndroidJavaObject jo = new AndroidJavaObject("android.os.Build");
  15. //string serial = jo.GetStatic<string>("SERIAL");
  16. //Debug.Log("±¾»úµÄSNÂëΪ:" + serial);
  17. // UILogManager.Instance.text3.text = serial;
  18. }
  19. float times = 11995;
  20. // Update is called once per frame
  21. void Update()
  22. {
  23. times += Time.deltaTime;
  24. if (times>12000)
  25. {
  26. times = 0;
  27. string androidID = SystemInfo.deviceUniqueIdentifier;
  28. Debug.Log("Android ID: " + androidID);
  29. UILogManager.Instance.text3.text = androidID;
  30. }
  31. }
  32. }