UnityEngine.AndroidJavaObject.GetStatic C# (CSharp) Method

GetStatic() public method

public GetStatic ( string fieldName ) : FieldType
fieldName string
return FieldType
		public FieldType GetStatic(string fieldName){}
		public void SetStatic(string fieldName, FieldType val){}

Usage Example

コード例 #1
0
ファイル: Location.cs プロジェクト: haoningz/zhn_old
    public static void Update()
    {
#if UNITY_EDITOR
        // fake coordinates for the editor
        Latitude  = 34.020189;
        Longitude = -118.288791;
        return;
#endif
        var unityPlayer = new AJObject("com.unity3d.player.UnityPlayer");
        var activity    = unityPlayer.GetStatic <AJObject>("currentActivity");
        var manager     = activity.Call <AJObject>("getSystemService", "location");
        var location    = manager.Call <AJObject>("getLastKnownLocation", "gps");
        Latitude  = location.Call <double>("getLatitude");
        Longitude = location.Call <double>("getLongitude");
        return;

        /*
         * if (history.Count >= 6) history.Dequeue();
         * history.Enqueue(new Tuple
         *  {
         *      Latitude = location.Call<double>("getLatitude"),
         *      Longitude = location.Call<double>("getLongitude")
         *  }
         * );
         * UpdateAverages();
         */
    }
All Usage Examples Of UnityEngine.AndroidJavaObject::GetStatic