Skip to content

Commit

Permalink
Wrap all android code in an #ifdef UNITY_ANDROID
Browse files Browse the repository at this point in the history
[CI BUILD]
  • Loading branch information
mikeage committed Nov 21, 2023
1 parent 910d0bc commit 96c1351
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Assets/Scripts/LoadingScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ private IEnumerator Start()

DontDestroyOnLoad(gameObject);

#if UNITY_ANDROID
if (Application.platform == RuntimePlatform.Android)
{
if (!UserHasManageExternalStoragePermission())
Expand All @@ -80,6 +81,7 @@ private IEnumerator Start()
m_Overlay.MessageStatus = m_LoadingText.GetLocalizedString();
}
}
#endif

AsyncOperation asyncLoad = SceneManager.LoadSceneAsync("Main");
while (!asyncLoad.isDone)
Expand Down Expand Up @@ -115,6 +117,7 @@ private void UpdateProgress(float start, float scale, float progress)
m_Overlay.Progress = m_CurrentLoadingPosition;
}

#if UNITY_ANDROID
private bool UserHasManageExternalStoragePermission()
{
return Permission.HasUserAuthorizedPermission("android.permission.MANAGE_EXTERNAL_STORAGE");
Expand All @@ -132,4 +135,5 @@ private void AskForManageStoragePermission()
currentActivityObject.Call("startActivity", intentObject);
}
}
} // namespace TiltBrush
#endif
} // namespace TiltBrush

0 comments on commit 96c1351

Please sign in to comment.