Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to mark certain referrenced assets not to be built into bundle

Discussion in 'Asset Bundles' started by Loewi_f, May 21, 2020.

  1. Loewi_f

    Loewi_f

    Joined:
    Nov 13, 2019
    Posts:
    30
    I have a scripatable asset,which referrence to other asset.I make a UNITY_EDITOR to it and want it not to be built into this bundle(that asset has its own bundle) ,but fail.Does anyone know anything wrong for this matter or how to handle it?

    MyAsset: ScriptableAsset
    {
    public int Index;
    #if UNITY_EDITOR
    public AnotherAsset AssetB; // Actually built into bundle,and has referrence in manifest
    #endif
    }


    myAsset.bundle + assetB.bundle
    myAsset.bundle.manifest:
    dependency: assetB.bundle
     
  2. Loewi_f

    Loewi_f

    Joined:
    Nov 13, 2019
    Posts:
    30
    I just want to make myAsset.bundle has no dependency.
     
  3. HoiTemmieColeg

    HoiTemmieColeg

    Joined:
    Aug 6, 2018
    Posts:
    6
    You can load the object through resources instead of serialization. You would have to manually add the object to the assetbundle if you wanted it, but it wouldn't be included if you didn't specify to.
     
  4. Loewi_f

    Loewi_f

    Joined:
    Nov 13, 2019
    Posts:
    30
    So,you mean that once serialized,this referrenced asset is obsolutely built into bundle or bundle dependency?