Question by
Mario_E · Oct 04, 2021 at 10:23 AM ·
unity 5unityeditor
How to change from WWW to the new UnityWebRequest.
Hey , Iam still a beginner and couldn't change from WWW to the new UnityWebRequest ,may anyone help ?
The current code is :
#if UNITY_WEBGL
public class PingHttp : PhotonPing
{
private WWW webRequest;
public override bool StartPing(string address)
{
base.Init();
address = "https://" + address + "/photon/m/?ping&r=" + UnityEngine.Random.Range(0, 10000);
this.webRequest = new WWW(address);
return true;
}
public override bool Done()
{
if (this.webRequest.isDone)
{
Successful = true;
return true;
}
return false;
}
public override void Dispose()
{
this.webRequest.Dispose();
}
}
#endif
and the error is : warning CS0618: 'WWW' is obsolete : 'Use UnityWebRequest,a fully featured replacement which is more efficient and has additional features Thank You !!
Comment