| 12345678910111213141516171819202122 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class GPSTool
- {
- public static string[] GetAddress()
- {
- string[] address = null;
- using (var clsU3D = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
- {
- using (var objCtx = clsU3D.GetStatic<AndroidJavaObject>("currentActivity"))
- {
- using (var objGPSTool = new AndroidJavaClass("com.example.smartbowlib.GPSTool"))
- {
- address = objGPSTool.CallStatic<string[]>("getAddress", objCtx);
- }
- }
- }
- return address;
- }
- }
|