3
3
#define USEFLOAT //Use floats for numbers instead of doubles (enable if you're getting too many significant digits in string output)
4
4
//#define POOLING //Currently using a build setting for this one (also it's experimental)
5
5
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
7
7
using UnityEngine ;
8
8
using Debug = UnityEngine . Debug ;
9
9
#endif
@@ -274,7 +274,7 @@ void Parse(string str, int maxDepth = -2, bool storeExcessLevels = false, bool s
274
274
if ( strict ) {
275
275
if ( str [ 0 ] != '[' && str [ 0 ] != '{' ) {
276
276
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
278
278
Debug . LogWarning
279
279
#else
280
280
Debug . WriteLine
@@ -363,7 +363,7 @@ void Parse(string str, int maxDepth = -2, bool storeExcessLevels = false, bool s
363
363
type = Type . NUMBER ;
364
364
} catch ( System . FormatException ) {
365
365
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
367
367
Debug . LogWarning
368
368
#else
369
369
Debug . WriteLine
@@ -694,7 +694,7 @@ static void MergeRecur(JSONObject left, JSONObject right) {
694
694
}
695
695
} else if ( left . type == Type . ARRAY && right . type == Type . ARRAY ) {
696
696
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
698
698
Debug . LogError
699
699
#else
700
700
Debug . WriteLine
@@ -753,7 +753,7 @@ public IEnumerable<string> PrintAsync(bool pretty = false) {
753
753
IEnumerable StringifyAsync ( int depth , StringBuilder builder , bool pretty = false ) { //Convert the JSONObject into a string
754
754
//Profiler.BeginSample("JSONprint");
755
755
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
757
757
Debug . Log
758
758
#else
759
759
Debug . WriteLine
@@ -899,7 +899,7 @@ IEnumerable StringifyAsync(int depth, StringBuilder builder, bool pretty = false
899
899
void Stringify ( int depth , StringBuilder builder , bool pretty = false ) { //Convert the JSONObject into a string
900
900
//Profiler.BeginSample("JSONprint");
901
901
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
903
903
Debug . Log
904
904
#else
905
905
Debug . WriteLine
@@ -1029,7 +1029,7 @@ void Stringify(int depth, StringBuilder builder, bool pretty = false) { //Conver
1029
1029
//Profiler.EndSample();
1030
1030
}
1031
1031
#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
1033
1033
public static implicit operator WWWForm( JSONObject obj ) {
1034
1034
WWWForm form = new WWWForm ( ) ;
1035
1035
for ( int i = 0 ; i < obj . list . Count ; i ++ ) {
@@ -1078,7 +1078,7 @@ public Dictionary<string, string> ToDictionary() {
1078
1078
case Type . NUMBER : result . Add ( keys [ i ] , val . n + "" ) ; break ;
1079
1079
case Type . BOOL : result . Add ( keys [ i ] , val . b + "" ) ; break ;
1080
1080
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
1082
1082
Debug . LogWarning
1083
1083
#else
1084
1084
Debug . WriteLine
@@ -1089,8 +1089,8 @@ public Dictionary<string, string> ToDictionary() {
1089
1089
}
1090
1090
return result ;
1091
1091
}
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
1094
1094
#else
1095
1095
Debug . WriteLine
1096
1096
#endif
0 commit comments