Search Unity

Windows Phone6 AssetBundle.Unload(false)

Discussion in 'Windows' started by hansionwx, Oct 2, 2013.

  1. hansionwx

    hansionwx

    Joined:
    Apr 20, 2013
    Posts:
    12
    Unity4.2.1

    When I call AssetBundle.Unload(false) to release memory.

    Error:
    AssetBundle.Unload(false) shouldn't be called because used assets might have to be reloaded at arbitrary time.If no assets are used, call AssetBundle.Unload(true).
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Doesn't that error explain what you did wrong? :)
     
  3. hansionwx

    hansionwx

    Joined:
    Apr 20, 2013
    Posts:
    12
    In WiP8 this method can not be used?
    But in the 4.2.0, IOS and Android, this method can be used
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Yes, in WP8 that method cannot be used with "false" argument. This is due to operating system limitation. We might have to reload all assets from bundles at any point in time, as D3D context gets flushed when user presses start menu key or locks the phone. That's why you cannot unload asset bundles when they are being used in scene on Windows Phone.
     
  5. hansionwx

    hansionwx

    Joined:
    Apr 20, 2013
    Posts:
    12
    I see. I will wp8 redesign set of resources scheme.
    Thank you
     
  6. vladrybak

    vladrybak

    Joined:
    Aug 30, 2013
    Posts:
    108
    Does this problem still exist on windows phone 8.1?
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Windows Phone 8.1 doesn't have this problem - the requirement to reload textures at application resume has been lifted by Microsoft.
     
  8. vladrybak

    vladrybak

    Joined:
    Aug 30, 2013
    Posts:
    108
    So AssetBundle.Unload(false) will work correct on Windows Phone 8.1?
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Yes, it works just fine on apps targeting WP8.1.
     
  10. Batdpd

    Batdpd

    Joined:
    Sep 3, 2013
    Posts:
    1
    After to 4.6.6 version I've been getting this error after calling Unload(False). I upgraded to 4.6.8 but doesn't work. Any update?
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Nope. This particular issue will never be fixed for Windows Phone 8.0. As I said, it does not affect games that target Windows Phone 8.1 SDK.