Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

What happened to www.LoadImageIntoTexture?

Discussion in '2017.1 Beta' started by bdovaz, Apr 22, 2017.

  1. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,042
    It's listed:

    https://docs.unity3d.com/2017.1/Documentation/ScriptReference/WWW.LoadImageIntoTexture.html

    But it has been removed from the API.

    I know that WWW it's going to be deprecated at some point but I use this method because we can do this (extracted from that page):

    Can we do this with Unity 2017 beta new UnityEngine.Networking.UnityWebRequestTexture class (that it's the same as UnityWebRequest but separated some static methods)? It only has:

    public static UnityWebRequest GetTexture(string uri);
    public static UnityWebRequest GetTexture(string uri, bool nonReadable);


    And we can't provide a previously created Texture2D instance.
     
  2. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    223
    This would be a real pain if it's gone for us too.
     
  3. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,091
    WWW.LoadImageIntoTexture replaces the texture so UnityWebRequest wouldn't be any different just that you have to set the texture yourself.
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    This method was accidentally lost when making WWW a thin wrapper on top of UnityWebRequest. It has been added back. Sorry for that.
     
    elbows and AFrisby like this.
  5. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,042
    Ok, thanks.

    What about my other question about UnityWebRquest and texture format?
     
  6. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,091
    Why would you need to supply an already created Texture2D instance?
    if you have a reference to that instance can't you just replace that texture with the one from UnityWebRequest.GetTexture?

    UnityWebRequest.GetTexture would else override the properties of the already allocated Texture2D instance