I got an obsolete warning after updating to Unity 4.5 :
Warning CS0618:
UnityEngine.WWW.WWW(string, byte[], System.Collections.Hashtable)' is obsolete:
This overload is deprecated. Use the one with Dictionary argument.' (CS0618) (Assembly-CSharp)
The codes are as follow:
public class Request {
public string url;
public NetworkDelegate del;
public WWWForm form;
public byte[] bytes;
public Hashtable header;
// Constructors
public Request(string url, NetworkDelegate del) {
this.url = url;
this.del = del;
}
public Request(string url, NetworkDelegate del, WWWForm form) : this(url, del) {
this.form = form;
}
public Request(string url, NetworkDelegate del, byte[] bytes) : this(url, del) {
this.bytes = bytes;
}
public Request(string url, NetworkDelegate del, byte[] bytes, Hashtable header) : this(url, del, bytes) {
this.header = header;
}
public WWW makeWWW() {
if(header != null) {
return new WWW(url, bytes, header); // problematic line
}
if(bytes != null) {
return new WWW(url, bytes);
}
if(form != null) {
return new WWW(url, form);
}
return new WWW(url);
}
}
How should I change the line?
The original codes can be found here.