Skip to content
This repository was archived by the owner on Feb 20, 2022. It is now read-only.

Commit 8802e7e

Browse files
committed
Check for current Unity Version in JSONObject
1 parent 8785c08 commit 8802e7e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

unity-project/Assets/3rd party/JSONObject/JSONObject.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#define USEFLOAT //Use floats for numbers instead of doubles (enable if you're getting too many significant digits in string output)
44
//#define POOLING //Currently using a build setting for this one (also it's experimental)
55

6-
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5
6+
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5 || UNITY_5_3_OR_NEWER
77
using UnityEngine;
88
using Debug = UnityEngine.Debug;
99
#endif
@@ -274,7 +274,7 @@ void Parse(string str, int maxDepth = -2, bool storeExcessLevels = false, bool s
274274
if(strict) {
275275
if(str[0] != '[' && str[0] != '{') {
276276
type = Type.NULL;
277-
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5
277+
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5 || UNITY_5_3_OR_NEWER
278278
Debug.LogWarning
279279
#else
280280
Debug.WriteLine
@@ -363,7 +363,7 @@ void Parse(string str, int maxDepth = -2, bool storeExcessLevels = false, bool s
363363
type = Type.NUMBER;
364364
} catch(System.FormatException) {
365365
type = Type.NULL;
366-
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5
366+
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5 || UNITY_5_3_OR_NEWER
367367
Debug.LogWarning
368368
#else
369369
Debug.WriteLine
@@ -694,7 +694,7 @@ static void MergeRecur(JSONObject left, JSONObject right) {
694694
}
695695
} else if(left.type == Type.ARRAY && right.type == Type.ARRAY) {
696696
if(right.Count > left.Count) {
697-
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5
697+
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5 || UNITY_5_3_OR_NEWER
698698
Debug.LogError
699699
#else
700700
Debug.WriteLine
@@ -753,7 +753,7 @@ public IEnumerable<string> PrintAsync(bool pretty = false) {
753753
IEnumerable StringifyAsync(int depth, StringBuilder builder, bool pretty = false) { //Convert the JSONObject into a string
754754
//Profiler.BeginSample("JSONprint");
755755
if(depth++ > MAX_DEPTH) {
756-
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5
756+
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5 || UNITY_5_3_OR_NEWER
757757
Debug.Log
758758
#else
759759
Debug.WriteLine
@@ -899,7 +899,7 @@ IEnumerable StringifyAsync(int depth, StringBuilder builder, bool pretty = false
899899
void Stringify(int depth, StringBuilder builder, bool pretty = false) { //Convert the JSONObject into a string
900900
//Profiler.BeginSample("JSONprint");
901901
if(depth++ > MAX_DEPTH) {
902-
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5
902+
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5 || UNITY_5_3_OR_NEWER
903903
Debug.Log
904904
#else
905905
Debug.WriteLine
@@ -1029,7 +1029,7 @@ void Stringify(int depth, StringBuilder builder, bool pretty = false) { //Conver
10291029
//Profiler.EndSample();
10301030
}
10311031
#endregion
1032-
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5
1032+
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5 || UNITY_5_3_OR_NEWER
10331033
public static implicit operator WWWForm(JSONObject obj) {
10341034
WWWForm form = new WWWForm();
10351035
for(int i = 0; i < obj.list.Count; i++) {
@@ -1078,7 +1078,7 @@ public Dictionary<string, string> ToDictionary() {
10781078
case Type.NUMBER: result.Add(keys[i], val.n + ""); break;
10791079
case Type.BOOL: result.Add(keys[i], val.b + ""); break;
10801080
default:
1081-
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5
1081+
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5 || UNITY_5_3_OR_NEWER
10821082
Debug.LogWarning
10831083
#else
10841084
Debug.WriteLine
@@ -1089,8 +1089,8 @@ public Dictionary<string, string> ToDictionary() {
10891089
}
10901090
return result;
10911091
}
1092-
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5
1093-
Debug.Log
1092+
#if UNITY_2 || UNITY_3 || UNITY_4 || UNITY_5 || UNITY_5_3_OR_NEWER
1093+
Debug.Log
10941094
#else
10951095
Debug.WriteLine
10961096
#endif

0 commit comments

Comments
 (0)