Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to change from www to new UnityWebRequest

PixelCgPixelCg Member
edited May 2020 in Programming

i have written code with 'www' but now its showing that it is obsolete.So can anyone help me, what should i change or add in code?

Comments

  • You do understand how vague this question is right? You provided no context or code at all.

    So based on that how are we suppose to know 'what' you should change or add to your code?

    There is plenty of information on UnityWebRequest https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.html

    Including examples on how to use it https://gist.github.com/emoacht/89590d4e4571d40f9e1b

  • PixelCgPixelCg Member
    edited May 2020

    This is the code:

    thanks for the documentation.

    (i am liitle new to the forum and unity so didnt know how to explain my doubt )


    using System.Collections;

    using System.Collections.Generic;

    using UnityEngine.UI;

    using UnityEngine;

    using UnityEditor;



    public class FileManager : MonoBehaviour

    {

      string path;

      public RawImage image;


      public void OpenExplorer ()

      {

        path = EditorUtility.OpenFilePanel("Overwrite with png", "", "png");

      }


      void GetImage ()

      {

        if (path != null )

        {

          UpdateImage();

        }

      }

      void UpdateImage ()

      {

        WWW www = new WWW("file///" + path);

        image.texture = www.texture;

      }

    }

Sign In or Register to comment.