Skip to content

Commit

Permalink
updated deprecated UnityWebRequest methods
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktHensen committed Oct 10, 2024
1 parent ed78ec5 commit e6c8da0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public async Task<WebResponse<string>> LoadAsync(string uri)
{
await req.SendWebRequest();

if (req.isNetworkError || req.isHttpError)
if (req.result == UnityWebRequest.Result.ConnectionError ||
req.result == UnityWebRequest.Result.ProtocolError)
{
i5Debug.LogError("Get request to: " + uri + " returned with error " + req.error, this);
return new WebResponse<string>(false, req.downloadHandler.text, req.downloadHandler.data, req.responseCode, req.error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public virtual async Task<WebResponse<string>> GetAsync(string uri, Dictionary<s

public virtual async Task<WebResponse<string>> PostAsync(string uri, string putJson, Dictionary<string, string> headers = null)
{
using (UnityWebRequest req = UnityWebRequest.Post(uri, putJson))
using (UnityWebRequest req = UnityWebRequest.PostWwwForm(uri, putJson))
{
req.downloadHandler = new DownloadHandlerBuffer();
req.SetRequestHeader("Content-Type", "application/json");
Expand Down
8 changes: 4 additions & 4 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"com.unity.ads": "4.4.2",
"com.unity.ai.navigation": "1.1.5",
"com.unity.analytics": "3.8.1",
"com.unity.collab-proxy": "2.3.1",
"com.unity.ide.rider": "3.0.28",
"com.unity.collab-proxy": "2.5.1",
"com.unity.ide.rider": "3.0.31",
"com.unity.ide.visualstudio": "2.0.22",
"com.unity.ide.vscode": "1.2.5",
"com.unity.nuget.newtonsoft-json": "3.2.1",
"com.unity.test-framework": "1.3.8",
"com.unity.testtools.codecoverage": "1.2.5",
"com.unity.textmeshpro": "3.0.6",
"com.unity.testtools.codecoverage": "1.2.6",
"com.unity.textmeshpro": "3.0.7",
"com.unity.timeline": "1.8.4",
"com.unity.ugui": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.10",
Expand Down
8 changes: 4 additions & 4 deletions Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "2.3.1",
"version": "2.5.1",
"depth": 0,
"source": "registry",
"dependencies": {},
Expand All @@ -65,7 +65,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "3.0.28",
"version": "3.0.31",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -137,7 +137,7 @@
"url": "https://packages.unity.com"
},
"com.unity.testtools.codecoverage": {
"version": "1.2.5",
"version": "1.2.6",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -147,7 +147,7 @@
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "3.0.6",
"version": "3.0.7",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
7 changes: 4 additions & 3 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ PlayerSettings:
resetResolutionOnWindowResize: 0
androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier: {}
applicationIdentifier:
Standalone: com.i5.i5-Toolkit-for-Unity
buildNumber:
Standalone: 0
VisionOS: 0
Expand Down Expand Up @@ -786,7 +787,6 @@ PlayerSettings:
syncCapabilities: 0
platformCapabilities:
WindowsStoreApps:
EnterpriseAuthentication: False
OfflineMapsManagement: False
HumanInterfaceDevice: False
Location: False
Expand All @@ -799,6 +799,7 @@ PlayerSettings:
InternetClientServer: True
VideosLibrary: False
Objects3D: False
InternetClient: True
RemoteSystem: False
BlockedChatMessages: False
PhoneCall: False
Expand All @@ -821,9 +822,9 @@ PlayerSettings:
RecordedCallsFolder: False
Contacts: False
Proximity: False
InternetClient: True
CodeGeneration: False
BackgroundMediaPlayback: False
EnterpriseAuthentication: False
metroTargetDeviceFamilies:
Desktop: False
Holographic: False
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2022.3.33f1
m_EditorVersionWithRevision: 2022.3.33f1 (b2c853adf198)
m_EditorVersion: 2022.3.47f1
m_EditorVersionWithRevision: 2022.3.47f1 (88c277b85d21)

0 comments on commit e6c8da0

Please sign in to comment.