Search Unity

Save AssetBundle assets in Editor?

Discussion in 'Asset Bundles' started by mikewarren, Nov 9, 2018.

  1. mikewarren

    mikewarren

    Joined:
    Apr 21, 2014
    Posts:
    109
    I'm looking for a way to save assets loaded from an asset bundle into the AssetDatabase in the Editor.
    Can anyone help me out?

    (In play mode) I can load the bundle, load the assets, and instantiate assets.
    All I'd like to do is save them as asset files in the database.
     
  2. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    559
  3. mikewarren

    mikewarren

    Joined:
    Apr 21, 2014
    Posts:
    109
    I tried that and get a message like the following...

    Couldn't add object to asset file because the GameObject 'tile_0_0' is already an asset at ''!
    UnityEditor.AssetDatabase:CreateAsset(Object, String)
    <LoadEm>c__Iterator0:MoveNext() (at Assets/Temp/LoadBundle.cs:63)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
    Librain likes this.
  4. q2030545195

    q2030545195

    Joined:
    Jan 12, 2020
    Posts:
    1
    Call 'Instantiate' to instantiate the asset, then save the instantiate object to an assset.