So theres a problem where unity is showing errors when they are none in visual studio
Assets\Resources\PlayFabSDK\Shared\Internal\PlayFabHttp\PlayFabUnityHttp.cs(122,14): error CS1026: ) expected
I’ve checked the lines but it’s perfectly fine, I’ve restarted unity but nothing happened. Why could this be happening.
And I believe that this is more of a unity problem then a PlayFab error.
using var www = new UnityWebRequest(reqContainer.FullUrl)
{
uploadHandler = new UploadHandlerRaw(reqContainer.Payload),
downloadHandler = new DownloadHandlerBuffer(),
method = "POST"
};
First one is on the first line, after using, second one is between } and ; on the last line
If you want the whole method, let me know
Oh okay, I don’t even know why I haven’t downloaded the newer version yet lol
EDIT: Also I won’t be able to use
using (UnityWebRequest www = new UnityWebRequest(reqContainer.FullUrl))
{
}
because the script required to use www out of that function and I won’t be able to, is there any other way I can syntax this, I also don’t wanna mess with the scripting so I’d appreciate some help.
PS- I can’t update also right now, so for the time being i’ll need to rearrange it
var www = new UnityWebRequest(reqContainer.FullUrl) { uploadHandler = new UploadHandlerRaw(reqContainer.Payload), downloadHandler = new DownloadHandlerBuffer(), method = "POST" };
it works, but just wanna make sure it’s doing the same thing as it should, it looks like it does
No you don’t want do do that. The point of a using statement is to dispose of managed resources automatically. Not doing so will result in memory leaks.
I’ve already tried that, I can’t do that before www is being defined only in that function, the script is accessing it outside of the function, so I will be getting a heap of errors, like so
var www = new UnityWebRequest(reqContainer.FullUrl);
using (www)
{
www.uploadHandler = new UploadHandlerRaw(reqContainer.Payload);
www.downloadHandler = new DownloadHandlerBuffer();
www.method = "POST";
}
using (var www = new UnityWebRequest(reqContainer.FullUrl))
{
www.uploadHandler = new UploadHandlerRaw(reqContainer.Payload);
www.downloadHandler = new DownloadHandlerBuffer();
www.method = "POST";
//rest of logic here
}