test.cs 986 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.Networking;
  5. using UnityEngine.UI;
  6. using XRTool.Util;
  7. public class test : UnitySingleton<test>
  8. {
  9. AndroidJavaObject jo;
  10. protected override void Awake()
  11. {
  12. base.Awake();
  13. AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
  14. jo = jc.GetStatic<AndroidJavaObject>("currentActivity");
  15. }
  16. public void CallAndroidImage()
  17. {
  18. jo.Call("startPhoto", "image/*");
  19. }
  20. public void CallAndroidVideo()
  21. {
  22. jo.Call("startPhoto", "video/*");
  23. }
  24. public static string path = "";
  25. public void message(string str)
  26. {
  27. Debug.Log("安卓传来信息:" + str);
  28. path = str;
  29. //StartCoroutine(LoadTexturePreview("file://" + str));
  30. WSHandler.Rtc.uploadCert();
  31. if (RoomMainForms.Instance)
  32. {
  33. RoomMainForms.Instance.ClickOnCanel();
  34. }
  35. }
  36. }