Search Unity

How to inform if the device is out of space?

Discussion in 'Addressables' started by Kapteeni-Studios, Jun 19, 2020.

  1. Kapteeni-Studios

    Kapteeni-Studios

    Joined:
    Apr 5, 2014
    Posts:
    39
    Hi,

    I load scenes in my mobile game like this from a server. The player will see a slider loading.

    Code (CSharp):
    1.     void Start()
    2.     {
    3.         StartCoroutine(LoadScene());
    4.     }
    5.  
    6.     IEnumerator LoadScene()
    7.     {
    8.         yield return null;
    9.         handle = Addressables.DownloadDependenciesAsync("SceneName");
    10.         yield return null;
    11.         while (!handle.IsDone)
    12.         {
    13.             SliderTarget = handle.PercentComplete;
    14.             yield return null;
    15.         }
    16.         if (handle.IsDone)
    17.         {
    18.             StartCoroutine(SceneLoaded());
    19.         }
    20.         if (handle.Status == AsyncOperationStatus.Failed)
    21.         {
    22.             // How to inform here if a player is out of disc space?
    23.         }
    24.     }
    My game already checks that the player is connected to the internet. I imagine that players will have their phones pretty full of games etc. What happens when they run out of disk space and try to load a bigger asset? When the loading fails for this reason, how could I inform the player about it?
     
  2. KwahuNashoba

    KwahuNashoba

    Joined:
    Mar 30, 2015
    Posts:
    110
    Necromancing this because I've been trying to find this information for hours with no luck. Have you find any info or made the device throw that exception so you can identify it?
     
  3. unity_krista

    unity_krista

    Unity Technologies

    Joined:
    Apr 28, 2020
    Posts:
    40
    Hi, there is an ongoing discussion about this topic, and we are looking into a good solution for checking whether there is sufficient space for bundle downloads. See this thread for more info
     
    KwahuNashoba likes this.