SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
599 B

4 years ago
  1. using System;
  2. using UnityEngine;
  3. namespace ARLocation
  4. {
  5. public static class AndroidMagneticDeclination
  6. {
  7. public static float GetDeclination(Location location)
  8. {
  9. #if PLATFORM_ANDROID
  10. long time = DateTimeOffset.Now.ToUnixTimeMilliseconds();
  11. var javaObject = new AndroidJavaObject("com.dmbfm.magneticdeclination.MagneticDeclination");
  12. return javaObject.Call<float>("GetMagneticDeclination", (float) location.Latitude, (float) location.Longitude, (float) location.Altitude, time);
  13. #else
  14. return 0.0f;
  15. #endif
  16. }
  17. }
  18. }