Exemple #1
0
        private float GetMagneticHeading()
        {
#if PLATFORM_ANDROID
            if (!SystemInfo.supportsGyroscope || !ApplyCompassTiltCompensationOnAndroid || androidNativeCompass == null)
            {
                if (ES3.Load <bool>("Test"))
                {
                    return(Camera.main.transform.rotation.eulerAngles.y);
                }
                else
                {
                    return(Input.compass.magneticHeading);
                }
                //return Input.compass.magneticHeading;
            }

            return(androidNativeCompass.GetMagneticHeading());

//            if (Screen.orientation == ScreenOrientation.Landscape)
//            {
//                return heading;// + 45;
//            }
//            else
//            {
//                return heading;
//            }
#else
            return(Input.compass.magneticHeading);
#endif
        }
        private float GetMagneticHeading()
        {
#if PLATFORM_ANDROID
            if (!SystemInfo.supportsGyroscope || !ApplyCompassTiltCompensationOnAndroid || androidNativeCompass == null)
            {
                return(Input.compass.magneticHeading);
            }

            return(androidNativeCompass.GetMagneticHeading());

//            if (Screen.orientation == ScreenOrientation.Landscape)
//            {
//                return heading;// + 45;
//            }
//            else
//            {
//                return heading;
//            }
#else
            return(Input.compass.magneticHeading);
#endif
        }