Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug (Case 1350105)Unloaded assets which referenced by MonoBehaviour is still null after reloading prefab

Discussion in '2021.2 Beta' started by Kichang-Kim, Jul 13, 2021.

  1. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,003
    Hi. I found that the issue related to asset memory management.

    Here is example:
    1. Prefab A has MeshFilter (reference to Mesh A) and MonoBehaviour (also has the field of Mesh A).
    2. Load Prefab A from assetbundle and unload Mesh A by using Resources.UnloadAsset().
    3. Re-load Prefab A from assetbundle, in this time MeshFilter has live Mesh A (correctly re-loaded) but MonoBehiavour has null reference.

    Minimal reproducible project was sent as Case 1350105.
     
    LeonhardP likes this.
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,124
    Thanks for the report @Kichang-Kim, we'll look into it!
     
  3. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,003