void GetGpsPermission() { switch (curDeviceMode) { case OsMode.android: if (pushOnce) { if (Permission.HasUserAuthorizedPermission(Permission.FineLocation)) { curGpsPermission = gpsPermission.agree; } else if (!Permission.HasUserAuthorizedPermission(Permission.FineLocation)) { curGpsPermission = gpsPermission.disagree; } if (curGpsPermission == gpsPermission.agree || curGpsPermission == gpsPermission.disagree) { Debug.Log("GPS permission clicked and get++++++++++"); gpsPopClicked = true; } } break; case OsMode.ios: Debug.Log("GPS permission clicked and get++++++++++"); gpsPopClicked = true; curGpsPermission = gpsPermission.agree; break; } }
private void Awake() { curPannelState = selectPannel.c_00_logo; gpsPopClicked = false; cameraPopClicked = false; pushOnce = false; panel_01_authorization.SetActive(false); panel_02_resource.SetActive(false); curGpsPermission = gpsPermission.notSet; curCameraPermission = cameraPermission.notSet; pushOnce = false; //get os status #if UNITY_ANDROID curDeviceMode = OsMode.android; #elif UNITY_IOS curDeviceMode = OsMode.ios; Screen.sleepTimeout = SleepTimeout.NeverSleep; #endif //check init status isInitApp = PlayerPrefs.GetString("isInitApp"); Debug.Log("curDeviceMode? =====>" + curDeviceMode); CheckPermissionState(); StartCoroutine(DelayOnLogo()); }
void CheckPermissionState() { Debug.Log(" is app initialized? ->" + isInitApp); switch (curDeviceMode) { case OsMode.android: if (Permission.HasUserAuthorizedPermission(Permission.FineLocation)) { curGpsPermission = gpsPermission.agree; gpsPopClicked = true; } if (Permission.HasUserAuthorizedPermission(Permission.Camera)) { //start loading json curCameraPermission = cameraPermission.agree; cameraPopClicked = true; } break; case OsMode.ios: if (isInitApp == "true") { Debug.Log(" isInitApp true initialized? "); curGpsPermission = gpsPermission.agree; gpsPopClicked = true; //start loading json curCameraPermission = cameraPermission.agree; cameraPopClicked = true; } break; } if (curGpsPermission == gpsPermission.agree && curCameraPermission == cameraPermission.agree) { skipPermission = true; } else { skipPermission = false; } Debug.Log(gpsPopClicked + "----gpsclicked?" + cameraPopClicked + "-------cameraClicked?"); }