gkngkc / UnityStandaloneFileBrowser

A native file browser for unity standalone platforms
MIT License
2.01k stars 317 forks source link

Multiple Obsolete Warning in Unity 2019.3 (use UnityWebRequest not WWW) #67

Closed itssource closed 4 years ago

itssource commented 4 years ago

Assets\StandaloneFileBrowser\Sample\CanvasSampleOpenFileTextMultiple.cs(56,30): warning CS0618: 'WWW' is obsolete: 'Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features'

Assets\StandaloneFileBrowser\Sample\CanvasSampleOpenFileText.cs(49,26): warning CS0618: 'WWW' is obsolete: 'Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features'

Assets\StandaloneFileBrowser\Sample\CanvasSampleOpenFileImage.cs(49,26): warning CS0618: 'WWW' is obsolete: 'Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features'

(noticed on Windows 10 Pro with Unity 2019.3(0b4))

foxnoodles commented 4 years ago

Those are sample files. just replace what it says if you still need them.

this: private IEnumerator OutputRoutine(string url) { var loader = new WWW(url); yield return loader; output.texture = loader.texture; }

to this:

private IEnumerator OutputRoutine (string url) { var loader = new UnityWebRequest(url); loader.downloadHandler = new DownloadHandlerBuffer(); yield return loader.SendWebRequest(); texture = loader.downloadHandler.texture; }

itssource commented 4 years ago

Thanks fox.