CloudManagerButton.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using SC;
  6. public class CloudManagerButton : MonoBehaviour
  7. {
  8. // public LoadPointVyncL_Eye _v_L;
  9. //public LoadPointVyncR_Eye _v_R;
  10. //public LoadPointVync _v;
  11. public CloudPoint _PointCloud;
  12. public static string ip;
  13. public GameObject keybood;
  14. public SCInputField text;
  15. // Start is called before the first frame update
  16. // public WebRtcManager _WebRtcManager;
  17. void Start()
  18. {
  19. ip = GetString("ip");
  20. text.text = ip;
  21. }
  22. public void setIP()
  23. {
  24. SetString("ip", text.text);
  25. Debug.Log(ip+" ipip");
  26. _PointCloud.ip = text.text;
  27. _PointCloud.enabled = true;
  28. keybood.SetActive(false);
  29. }
  30. /// <summary>
  31. /// 储存String
  32. /// </summary>
  33. /// <param name="key">键</param>
  34. /// <param name="value">值</param>
  35. public static void SetString(string key, string value)
  36. {
  37. PlayerPrefs.SetString(key, value);
  38. PlayerPrefs.Save();
  39. }
  40. /// <summary>
  41. /// 取String
  42. /// </summary>
  43. /// <param name="key">键</param>
  44. /// <returns></returns>
  45. public static string GetString(string key)
  46. {
  47. return PlayerPrefs.GetString(key);
  48. }
  49. /*public static string GetOpenGL()
  50. {
  51. string version = "0";
  52. #if (UNITY_ANDROID && !UNITY_EDITOR) || ANDROID_CODE_VIEW
  53. try
  54. {
  55. AndroidJavaClass unityPlayer = AndroidJavaClass("com.unity3d.player.UnityPlayer");
  56. AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
  57. AndroidJavaObject curApplication = currentActivity.Call<AndroidJavaObject>("getApplication");
  58. AndroidJavaObject curSystemService = curApplication.Call<AndroidJavaObject>("getSystemService", "activity");
  59. AndroidJavaObject curConfigurationInfo = curSystemService.Call<AndroidJavaObject>("getDeviceConfigurationInfo");
  60. int reqGlEsVersion = curConfigurationInfo.Get<int>("reqGlEsVersion");
  61. AndroidJavaClass curInteger = AndroidJavaClass("java.lang.Integer");
  62. version = curInteger.CallStatic<string>("toString",reqGlEsVersion,16);
  63. }
  64. catch (Exception e)
  65. {
  66. ILog.Warn(TAG + ", GetOpenGL, Exception: " + e.ToString());
  67. }
  68. #elif (UNITY_IOS && !UNITY_EDITOR) || IOS_CODE_VIEW
  69. version = "-1";
  70. #endif
  71. return version;
  72. }*/
  73. // Update is called once per frame
  74. void Update()
  75. {
  76. if (Input.GetKeyDown(KeyCode.Escape))
  77. {
  78. Application.Quit();
  79. }
  80. }
  81. public void addhead()
  82. {
  83. // _PointCloud.offsetZ += 1;
  84. _PointCloud.headPointSize += 0.001f;
  85. }
  86. public void redhead()
  87. {
  88. // _PointCloud.offsetZ -= 1;
  89. _PointCloud.headPointSize -= 0.001f;
  90. }
  91. public void addbody()
  92. {
  93. // _PointCloud.offsetZ += 1;
  94. _PointCloud.bodyPointSize += 0.001f;
  95. }
  96. public void redbody()
  97. {
  98. // _PointCloud.offsetZ -= 1;
  99. _PointCloud.bodyPointSize -= 0.001f;
  100. }
  101. }