Search Unity

GameObject is referenced to UnityEngine.CoreModule - Addressables 1.2.2

Discussion in 'Addressables' started by pahe4retro, Sep 12, 2019.

  1. pahe4retro

    pahe4retro

    Joined:
    Aug 13, 2019
    Posts:
    33
    Hi guys.

    I'm pretty new to addressables and wanted to integrate the new 1.2.2. package into my custom dll. Now I get the error message:

    Code (CSharp):
    1. The type 'GameObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
    I'm referencing the monolithic UnityEngine.dll in my custom dll and it works fine with other stuff. Also referencing the Unity.Addressables and Unity.ResourceManager, so from my understanding, that should work, as when I add the reference to the UnityEngine.CoreModule, I get duplicate symbols for GameObject as expected.

    Does anyone reference the addressables dlls in his own dll project and it works for him? When I move my script into my Unity project, it works totally fine.

    Thanks for help,
    Patrick
     
  2. pahe4retro

    pahe4retro

    Joined:
    Aug 13, 2019
    Posts:
    33
    Adding some more info as I dig deeper into the problem. Interestingly the problem seems only to occur with
    Addressables.ReleaseInstance(GameObject);


    Code (CSharp):
    1.         public void LoadAssetbundle<T>(string identifer) where T : UnityEngine.Object
    2.         {
    3.             Addressables.LoadAssetAsync<T>(identifer); // works fine, no error
    4.         }
    5.  
    6.         public void ReleaseAsset(GameObject gameObject)
    7.         {
    8.             Addressables.ReleaseInstance(gameObject); // NOTE: not fine. wants reference to UnityEngine.CoreModule
    9.         }
     
    Last edited: Sep 16, 2019
  3. pahe4retro

    pahe4retro

    Joined:
    Aug 13, 2019
    Posts:
    33
    @unity_bill maybe you have some insights into this? I'm out of ideas how to solve this, except for moving my code into my Unity procect (what I would preferably avoid :) ).

    Update: I *guess* the Addressables.ReleaseInstance(GameObject go); function is not present in my monolithic UnityEngine.dll. I'm using 2019.2.4f1, haven't tried a newer version yet, but that may be the problem.
     
    Last edited: Sep 16, 2019
  4. pahe4retro

    pahe4retro

    Joined:
    Aug 13, 2019
    Posts:
    33
    Another update: After a lot of searching, I guess I found an answer to my problem here.

    TL-DR Unity doesn't support referencing generated dlls from packages officially (yet). So, if you try to reference the Addressables dll from outside of a custom dll project, you're in a bad spot.

    Would be nice to hear an update from the Unity guys on this problem though.