Search Unity

Backwards compatibility: U3.5 asset bundle migration to U5.x

Discussion in 'Asset Bundles' started by BobMitchell, Jul 12, 2017.

  1. BobMitchell

    BobMitchell

    Joined:
    Dec 19, 2013
    Posts:
    2
    I have a project that is being brought back to support iOS 64bit.
    It uses asset bundles build in Unity 3.5.
    We'd like to use Unity 5.5. I'll take any version that supports 64bit.

    The catch - we only have assetbundles and not the raw assets for some things.
    And thus no way to rebuild the assetbundles.

    We're using 2d Toolkit if that matters.

    Is there some way to save assetbundles in the new format?
    Is there some way to read in the raw assets and save them?
    Any other suggestions?

    0) The original unity project with these assets is lost
    I have the project that loads the assetbundles.

    1) I've found DisUnity that can extract some of the data.
    https://github.com/ata4/disunity
    It doesn't extract enough - no animationsClips, none of the GameObjects

    2) I've tried dragging the item created in the scene into the project - it generates an object with empty elements. And none of the required assets

    3) I've looked for scripts that will do something similar except in code.

    4) I've considered rebuilding the scene by stepping through the objects in U3.5 but when I do that, I get the following popup error dialog:
    - rebuilding index. scanning project folder
    That hangs the Editor.



    Here's a shortened list of the contents of one of the asset bundles.

    PID | CID | Class name | Offset | Size | Object name
    ------------ | ---- | ------------------------ | ---------- | ---------- | -----------
    1 | 142 | AssetBundle | 0x0 | 2096 |
    2 | 21 | Material | 0x830 | 160 | background
    3 | 21 | Material | 0x8d0 | 76 | atlas0 material
    4 | 28 | Texture2D | 0x920 | 5592476 | atlas0
    5 | 28 | Texture2D | 0x555ec0 | 699216 | back_tex
    6 | 43 | Mesh | 0x600a10 | 8156 | room_wall_mesh
    7 | 48 | Shader | 0x6029f0 | 1740 | BlendVertexColor
    8 | 74 | AnimationClip | 0x6030c0 | 296 | background_scroll
    9 | 83 | AudioClip | 0x6031e8 | 749576 | audio
    10 | 115 | MonoScript | 0x6ba1f0 | 69 | tk2dSprite
    11 | 115 | MonoScript | 0x6ba238 | 93 | tk2dSpriteCollectionData
    12 | 1 | GameObject | 0x6ba298 | 63 | spriteCollection
    21 | 1 | GameObject | 0x6ba4d8 | 59 | room
    28 | 4 | Transform | 0x6ba6e0 | 60 |
    29 | 4 | Transform | 0x6ba720 | 60 |
    44 | 23 | MeshRenderer | 0x6bab50 | 64 |
    45 | 23 | MeshRenderer | 0x6bab90 | 64 |
    53 | 33 | MeshFilter | 0x6bad90 | 16 |
    54 | 33 | MeshFilter | 0x6bada0 | 16 |
    62 | 82 | AudioSource | 0x6bae20 | 164 |
    63 | 108 | Light | 0x6baec8 | 104 |
    64 | 108 | Light | 0x6baf30 | 104 |
    65 | 108 | Light | 0x6baf98 | 104 |
    66 | 111 | Animation | 0x6bb000 | 68 |

    thanks.
    Bob
     
  2. BobMitchell

    BobMitchell

    Joined:
    Dec 19, 2013
    Posts:
    2
    The path I'm taking is dumping the object as a text file to disk as I'm creating it in Unity 3.5 after reading in from the assetbundle.
    And then I'll recreate it in Unity 5.5 (even if manually, getting the data was the blocker)

    My scene dumper is based on this:
    http://wiki.unity3d.com/index.php?title=SceneDumper

    Just writing out useful info like transform position, rotation (if not Q.identity), scale (if not Vector3.one)

    Comparing two scenes, I would have never guessed the light rigs were different. Well, I did guess they might be. The dump showed me there were and what I need to do to recreate them.

    The one thing I really wanted to recover was the animations. This looks like it should work.
    http://answers.unity3d.com/questions/50596/possible-to-save-animations-created-from-script-as.html
    And indeed it does, I am saving the "lost" animations.

    Next, I'm going to look at using the AssetDatabase to save the primary game object so I don't have to recreate all the transform data in the tree.


    +environment_one
    Transform name: environment_one
    Pos (0.0, 0.0, 0.0)
    Rot (359.4, 180.0, 0.0)
    AudioSource name: environment_one
    Clip environment_one_audio
    +background_static
    Transform name: background_static
    Pos (-12.0, -1.0, 15.7)
    MeshFilter name: background_static
    Mesh plane Instance
    MeshRenderer name: background_static
    tk2dSprite name: background_static
    +LIGHT_RIG
    Transform name: LIGHT_RIG
    Pos (0.0, 12.0, 0.1)
    Rot (359.4, 180.0, 0.0)
    +back_light
    Transform name: back_light
    Pos (0.0, 0.0, 0.0)
    Rot (55.0, 28.6, 203.2)
    Light name: back_light
    Color RGBA(0.872, 1.000, 0.459, 1.000) intensity 0.32
    +key_light
    Transform name: key_light
    Pos (0.0, 0.0, 0.0)
    Rot (27.2, 231.2, 34.0)
    Light name: key_light
    Color RGBA(0.846, 0.847, 0.578, 1.000) intensity 0.46
    +back
    Transform name: back
    Pos (0.0, -3.4, 23.0)
    Rot (359.4, 180.0, 0.0)
    Scale (2.1, 2.1, 2.1)
    MeshFilter name: back
    Mesh room_wall_mesh
    MeshRenderer name: back
    Animation name: environment_one_back
    Name environment_one_back
    Saved as Assets/environment_one_back.anim