Search Unity

0.6.6 - is available but...

Discussion in 'Addressables' started by Mazak, Mar 6, 2019.

  1. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Was 0.6.6 made available by mistake?
     
  2. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Same question here. And why the Addressable.Instantiate is not generic anymore? What if I want to instantiate Material and not only gameObject?
     
  3. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    Last edited: Mar 6, 2019
  4. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    The problem with the original API is that it works for GameObject and for standalone assets but silently fails on components.

    Since 5.0 it is no longer possible to instantiate a prefab via Instantiate<T>() where T : Component off an AssetBundle.

    Stopping this means that Instantiate has to be not allowed on T : Component. Problem is, Material, etc. are all derived from Object, which makes it tricky to stop it for Component and not stop it for Material and other native assets.
     
    MNNoxMortem likes this.
  5. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    559
    it could be resolved internally with:
    - try to load/instantiate T
    - if it fails, try to load/instantiate GameObject, then .GetComponent<T>()

    (do not check T is Component, because interfaces are allowed in GetComponent)

    until then, you can write an extension/wrapper method that does that
     
  6. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    That does sound a bit icky. Maybe it could be solved in a cleaner way by storing some type metadata on the catalogue.