Search Unity

Problem using old version assetbundle in newer version unity.

Discussion in 'Editor & General Support' started by geolee, Jan 12, 2018.

  1. geolee

    geolee

    Joined:
    Jul 18, 2017
    Posts:
    8
    I can't upload image, so you can read the attachment directly.

    I have some assetbundle created by old version unity, now I use new version (2017.3), the problems are shown below:

    In editor play mode, when I load the asset, I got the console info:



    And It appears all pink. the material inspector shows abnormal layout not as a Standard shader should be.



    But, after reselect the same shader,


    the material’s layout shows right, and the scene object shows right.



    So I try to fix this problem by reassign the same shader to the material using some code like below:

    Code (csharp):
    1.  
    2.  
    3. renderer.material.shader = Shader.Find(renderer.material.shader.name)
    4.  
    5.  
    the code seems works well in forward render,



    but in deferred render, the transparent objects like window glasses are opaque:



    it appears that the material’s parameters are all right:



    it’s curious that when you expand the material inspector or modify any parameters of the material, the window glasses appears as it should be.



    The biggest problem is that when running in build player mode, it doesn’t work, all are pink or empty.


    So…… how to fix this problem using old assetbundle in newer version unity.


    I heard something about shader variants, but don’t know how it works and how to use it.
     

    Attached Files:

  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    Rebuild asset bundles with 2017.3. Unity introduced various breaking changes across various Unity versions and old formats often can't be read anymore.
     
  3. geolee

    geolee

    Joined:
    Jul 18, 2017
    Posts:
    8
    thanks for your reply. but rebuild the asset may not be suitable for me.
    in editor mode, fix code works, so i think there's a little chance to do in build mode, hope......
     
  4. shanghaixianjian

    shanghaixianjian

    Joined:
    Dec 3, 2019
    Posts:
    1
    I also encountered such a situation at the moment, the 5.3.1 version is not applicable in 2019, I do not know how to solve