Skip to content

Commit ab2d0be

Browse files
JohannesLootkristijan-ujevic
authored andcommitted
- Fixed Scene meta-file
- Removed unused using-statements - Added support for versions below Unity 2020
1 parent 08b0e09 commit ab2d0be

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

Samples~/LootLockerExamples/Scenes/7 - PlayerFiles.unity

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ MonoBehaviour:
412412
m_TargetGraphic: {fileID: 2012542011}
413413
m_HandleRect: {fileID: 2012542010}
414414
m_Direction: 2
415-
m_Value: 0
415+
m_Value: 1
416416
m_Size: 1
417417
m_NumberOfSteps: 0
418418
m_OnValueChanged:
@@ -900,7 +900,7 @@ MonoBehaviour:
900900
m_HandleRect: {fileID: 111827319}
901901
m_Direction: 2
902902
m_Value: 1
903-
m_Size: 0.9999955
903+
m_Size: 1
904904
m_NumberOfSteps: 0
905905
m_OnValueChanged:
906906
m_PersistentCalls:
@@ -1774,7 +1774,7 @@ RectTransform:
17741774
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
17751775
m_AnchorMin: {x: 0, y: 0.21287362}
17761776
m_AnchorMax: {x: 0.29025, y: 0.48947424}
1777-
m_AnchoredPosition: {x: 6.599365, y: 4.000084}
1777+
m_AnchoredPosition: {x: 6.599365, y: 4.0001526}
17781778
m_SizeDelta: {x: -13.199, y: 8}
17791779
m_Pivot: {x: 0.5, y: 0.5}
17801780
--- !u!114 &1076014855
@@ -1999,7 +1999,7 @@ RectTransform:
19991999
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
20002000
m_AnchorMin: {x: 0, y: 0}
20012001
m_AnchorMax: {x: 1, y: 0.5}
2002-
m_AnchoredPosition: {x: 8.501343, y: 71.597046}
2002+
m_AnchoredPosition: {x: 8.501343, y: 65.43576}
20032003
m_SizeDelta: {x: 16.070007, y: 0}
20042004
m_Pivot: {x: 0.5, y: 0.5}
20052005
--- !u!222 &1312418105
@@ -2362,7 +2362,7 @@ RectTransform:
23622362
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
23632363
m_AnchorMin: {x: 0, y: 0}
23642364
m_AnchorMax: {x: 1, y: 0.88400006}
2365-
m_AnchoredPosition: {x: -0.0005950928, y: 0.47702026}
2365+
m_AnchoredPosition: {x: -0.00061035156, y: 0.47702026}
23662366
m_SizeDelta: {x: 0.070007324, y: 1.0399933}
23672367
m_Pivot: {x: 0.5, y: 0.5}
23682368
--- !u!114 &1413720024
@@ -3041,7 +3041,7 @@ RectTransform:
30413041
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
30423042
m_AnchorMin: {x: 0, y: 0.88400006}
30433043
m_AnchorMax: {x: 1, y: 1}
3044-
m_AnchoredPosition: {x: -0.00024414062, y: 0.5174866}
3044+
m_AnchoredPosition: {x: -0.00024414062, y: 0.51750183}
30453045
m_SizeDelta: {x: 0.070007324, y: -0.951004}
30463046
m_Pivot: {x: 0.5, y: 0.5}
30473047
--- !u!114 &1981278692

Samples~/LootLockerExamples/Scenes/7 - PlayerFiles.unity.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Samples~/LootLockerExamples/Scripts/PlayerFiles.cs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
using LootLocker.Requests;
2-
using Newtonsoft.Json;
3-
using System;
42
using System.Collections;
5-
using System.Collections.Generic;
63
using System.IO;
4+
using System.Net;
75
using System.Text;
86
using UnityEngine;
97
using UnityEngine.Networking;
@@ -105,14 +103,18 @@ IEnumerator Download(string url, System.Action<string> fileContent)
105103
UnityWebRequest www = new UnityWebRequest(url);
106104
www.downloadHandler = new DownloadHandlerBuffer();
107105
yield return www.SendWebRequest();
108-
109-
if (www.result != UnityWebRequest.Result.Success)
110-
{
111-
Debug.Log(www.error);
112-
}
113-
else
114-
{
115-
// Show results as text
106+
// Unity 2020.1 and newer does not use isNetworkError and isHttpError anymore
107+
#if UNITY_2020_1_OR_NEWER
108+
if (www.result != UnityWebRequest.Result.Success)
109+
#else
110+
if (www.isNetworkError || www.isHttpError)
111+
#endif
112+
{
113+
Debug.Log(www.error);
114+
}
115+
else
116+
{
117+
// Show results as text
116118
Debug.Log(www.downloadHandler.text);
117119
fileContent(www.downloadHandler.text);
118120
}

0 commit comments

Comments
 (0)