Search Unity

Question Bundling Assets for Oculus Quest 2

Discussion in 'VR' started by mehrdadkhnzd, Feb 16, 2023.

  1. mehrdadkhnzd

    mehrdadkhnzd

    Joined:
    Feb 16, 2023
    Posts:
    1
    Hi,
    I want to read a binary file in runtime. The binary file is a previously serialized object.
    First I didn't know I need asset bundling, and I read the file directly, so the final APK didn't work.
    Then I added AssetBundle and made it work in play mode, both using `AssetBundle.LoadFromFile` and
    `UnityWebRequestAssetBundle.GetAssetBundle`, but neither worked in APK again. I can confirm that the assets exist in the final APK by looking into it, and I can also confirm I'm using a platform-independent path (`Path.Combine(Application.streamingAssetsPath, "assetBundle"`).
    I also create asset bundles just like the tutorial, using this: `BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget)`
    I also tried to switch to Addressables and I set everything up, but sometimes it crashes and other times it doesn't work properly, even in play mode. I heard people always have problems with it so I'm not sure if it's the best direction. It also doesn't produce an error message.
    Anyway, I'm stuck with it, and I can't make it work. Any help would be really appreciated!