Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question from asset bundle to On Demand Resource

Discussion in 'Editor & General Support' started by Dev_Pcpt, Jun 23, 2021.

  1. Dev_Pcpt

    Dev_Pcpt

    Joined:
    Oct 2, 2017
    Posts:
    2
    Hi,

    I'm currently looking to implement On Demand Resource on my project.
    I already use Asset Bundle, but I'd want some of them to be On Demand Resource.

    I found this page https://docs.unity3d.com/2019.4/Documentation/Manual/AppThinning.html

    And there is things that I'm not sure to understand.
    So I need to create a script BuildiOSAssetBundles to tell Unity which Asset Bundle I want to use as ODR.
    But I'm confuse by this line :

    Code (CSharp):
    1. new UnityEditor.iOS.Resource( "bundle", "Assets/Bundles/bundle.unity3d" ).AddOnDemandResourceTags("bundle"),
    I didn't found the documentation of Unity.iOS.Resource object, and I'm a bit confused about the path I should give.
    For exemple, I have a bundle named "foo/bar", which is composed of 3 scenes : "foo_level1", "foo_level2", and "foo_level3", let's say that theses scenes are located in a folder named "Assets/Foo/Scenes".

    How do i do to tell Unity that this bundle should be a On Demand Resource ?
    Plus, I have a lot of bundle similar to "foo/bar" (let's say 50). Do I have to register them one by one in that script ? Or is there a way to "mark" every bundle starting with "foo/" as ODR ? (Is there a GUI ?)


    Thanks for reading my message :)

    EDIT : When I build my assets bundles, the path is "AssetBundles/iOS". May be I should use that in the path ?
     
    Last edited: Jun 23, 2021