Question by
cargermonqui · Jan 25, 2021 at 09:38 PM ·
unity 5wwwwebrequest
How to replace WWW to UnityWebRequest
using Dummiesman;
using System.IO;
using System.Text;
using UnityEngine;
public class ObjFromStream : MonoBehaviour {
void Start () {
//make www
var www = new WWW("https://people.sc.fsu.edu/~jburkardt/data/obj/lamp.obj");
while (!www.isDone)
System.Threading.Thread.Sleep(1);
//create stream and load
var textStream = new MemoryStream(Encoding.UTF8.GetBytes(www.text));
var loadedObj = new OBJLoader().Load(textStream);
}
}
Comment