using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using TranslationCommon.SimpleJSON;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("DspFontPatcher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DspFontPatcher")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("81DF3045-8007-4F6A-AAF6-903139D85B6C")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
namespace TranslationCommon.SimpleJSON
{
public enum JSONNodeType
{
Array = 1,
Object = 2,
String = 3,
Number = 4,
NullValue = 5,
Boolean = 6,
None = 7,
Custom = 255
}
public enum JSONTextMode
{
Compact,
Indent
}
public abstract class JSONNode
{
public struct Enumerator
{
private enum Type
{
None,
Array,
Object
}
private readonly Type type;
private Dictionary<string, JSONNode>.Enumerator m_Object;
private List<JSONNode>.Enumerator m_Array;
public bool IsValid => type != Type.None;
public KeyValuePair<string, JSONNode> Current
{
get
{
if (type == Type.Array)
{
return new KeyValuePair<string, JSONNode>(string.Empty, m_Array.Current);
}
if (type == Type.Object)
{
return m_Object.Current;
}
return new KeyValuePair<string, JSONNode>(string.Empty, null);
}
}
public Enumerator(List<JSONNode>.Enumerator aArrayEnum)
{
type = Type.Array;
m_Object = default(Dictionary<string, JSONNode>.Enumerator);
m_Array = aArrayEnum;
}
public Enumerator(Dictionary<string, JSONNode>.Enumerator aDictEnum)
{
type = Type.Object;
m_Object = aDictEnum;
m_Array = default(List<JSONNode>.Enumerator);
}
public bool MoveNext()
{
if (type == Type.Array)
{
return m_Array.MoveNext();
}
if (type == Type.Object)
{
return m_Object.MoveNext();
}
return false;
}
}
public struct ValueEnumerator
{
private Enumerator m_Enumerator;
public JSONNode Current => m_Enumerator.Current.Value;
public ValueEnumerator(List<JSONNode>.Enumerator aArrayEnum)
: this(new Enumerator(aArrayEnum))
{
}
public ValueEnumerator(Dictionary<string, JSONNode>.Enumerator aDictEnum)
: this(new Enumerator(aDictEnum))
{
}
public ValueEnumerator(Enumerator aEnumerator)
{
m_Enumerator = aEnumerator;
}
public bool MoveNext()
{
return m_Enumerator.MoveNext();
}
public ValueEnumerator GetEnumerator()
{
return this;
}
}
public struct KeyEnumerator
{
private Enumerator m_Enumerator;
public string Current => m_Enumerator.Current.Key;
public KeyEnumerator(List<JSONNode>.Enumerator aArrayEnum)
: this(new Enumerator(aArrayEnum))
{
}
public KeyEnumerator(Dictionary<string, JSONNode>.Enumerator aDictEnum)
: this(new Enumerator(aDictEnum))
{
}
public KeyEnumerator(Enumerator aEnumerator)
{
m_Enumerator = aEnumerator;
}
public bool MoveNext()
{
return m_Enumerator.MoveNext();
}
public KeyEnumerator GetEnumerator()
{
return this;
}
}
public class LinqEnumerator : IEnumerator<KeyValuePair<string, JSONNode>>, IDisposable, IEnumerator, IEnumerable<KeyValuePair<string, JSONNode>>, IEnumerable
{
private Enumerator m_Enumerator;
private JSONNode m_Node;
public KeyValuePair<string, JSONNode> Current => m_Enumerator.Current;
object IEnumerator.Current => m_Enumerator.Current;
internal LinqEnumerator(JSONNode aNode)
{
m_Node = aNode;
if (m_Node != null)
{
m_Enumerator = m_Node.GetEnumerator();
}
}
public IEnumerator<KeyValuePair<string, JSONNode>> GetEnumerator()
{
return new LinqEnumerator(m_Node);
}
IEnumerator IEnumerable.GetEnumerator()
{
return new LinqEnumerator(m_Node);
}
public bool MoveNext()
{
return m_Enumerator.MoveNext();
}
public void Dispose()
{
m_Node = null;
m_Enumerator = default(Enumerator);
}
public void Reset()
{
if (m_Node != null)
{
m_Enumerator = m_Node.GetEnumerator();
}
}
}
[CompilerGenerated]
private sealed class <get_Children>d__49 : IEnumerable<JSONNode>, IEnumerable, IEnumerator<JSONNode>, IDisposable, IEnumerator
{
private int <>1__state;
private JSONNode <>2__current;
private int <>l__initialThreadId;
public JSONNode <>4__this;
JSONNode IEnumerator<JSONNode>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <get_Children>d__49(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
if (<>1__state != 0)
{
return false;
}
<>1__state = -1;
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<JSONNode> IEnumerable<JSONNode>.GetEnumerator()
{
<get_Children>d__49 result;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
result = this;
}
else
{
result = new <get_Children>d__49(0)
{
<>4__this = <>4__this
};
}
return result;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<JSONNode>)this).GetEnumerator();
}
}
[CompilerGenerated]
private sealed class <get_DeepChildren>d__51 : IEnumerable<JSONNode>, IEnumerable, IEnumerator<JSONNode>, IDisposable, IEnumerator
{
private int <>1__state;
private JSONNode <>2__current;
private int <>l__initialThreadId;
public JSONNode <>4__this;
private IEnumerator<JSONNode> <>s__1;
private JSONNode <C>5__2;
private IEnumerator<JSONNode> <>s__3;
private JSONNode <D>5__4;
JSONNode IEnumerator<JSONNode>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <get_DeepChildren>d__51(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if ((uint)(num - -4) <= 1u || num == 1)
{
try
{
if (num == -4 || num == 1)
{
try
{
}
finally
{
<>m__Finally2();
}
}
}
finally
{
<>m__Finally1();
}
}
<>s__1 = null;
<C>5__2 = null;
<>s__3 = null;
<D>5__4 = null;
<>1__state = -2;
}
private bool MoveNext()
{
try
{
int num = <>1__state;
if (num != 0)
{
if (num != 1)
{
return false;
}
<>1__state = -4;
<D>5__4 = null;
goto IL_00b5;
}
<>1__state = -1;
<>s__1 = <>4__this.Children.GetEnumerator();
<>1__state = -3;
goto IL_00d7;
IL_00b5:
if (<>s__3.MoveNext())
{
<D>5__4 = <>s__3.Current;
<>2__current = <D>5__4;
<>1__state = 1;
return true;
}
<>m__Finally2();
<>s__3 = null;
<C>5__2 = null;
goto IL_00d7;
IL_00d7:
if (<>s__1.MoveNext())
{
<C>5__2 = <>s__1.Current;
<>s__3 = <C>5__2.DeepChildren.GetEnumerator();
<>1__state = -4;
goto IL_00b5;
}
<>m__Finally1();
<>s__1 = null;
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
if (<>s__1 != null)
{
<>s__1.Dispose();
}
}
private void <>m__Finally2()
{
<>1__state = -3;
if (<>s__3 != null)
{
<>s__3.Dispose();
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<JSONNode> IEnumerable<JSONNode>.GetEnumerator()
{
<get_DeepChildren>d__51 result;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
result = this;
}
else
{
result = new <get_DeepChildren>d__51(0)
{
<>4__this = <>4__this
};
}
return result;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<JSONNode>)this).GetEnumerator();
}
}
[ThreadStatic]
private static StringBuilder m_EscapeBuilder;
public static bool forceASCII = false;
public static bool longAsString = false;
public static bool allowLineComments = true;
public static byte Color32DefaultAlpha = byte.MaxValue;
public static float ColorDefaultAlpha = 1f;
public static JSONContainerType VectorContainerType = JSONContainerType.Array;
public static JSONContainerType QuaternionContainerType = JSONContainerType.Array;
public static JSONContainerType RectContainerType = JSONContainerType.Array;
public static JSONContainerType ColorContainerType = JSONContainerType.Array;
internal static StringBuilder EscapeBuilder
{
get
{
if (m_EscapeBuilder == null)
{
m_EscapeBuilder = new StringBuilder();
}
return m_EscapeBuilder;
}
}
public abstract JSONNodeType Tag { get; }
public virtual JSONNode this[int aIndex]
{
get
{
return null;
}
set
{
}
}
public virtual JSONNode this[string aKey]
{
get
{
return null;
}
set
{
}
}
public virtual string Value
{
get
{
return "";
}
set
{
}
}
public virtual int Count => 0;
public virtual bool IsNumber => false;
public virtual bool IsString => false;
public virtual bool IsBoolean => false;
public virtual bool IsNull => false;
public virtual bool IsArray => false;
public virtual bool IsObject => false;
public virtual bool Inline
{
get
{
return false;
}
set
{
}
}
public virtual IEnumerable<JSONNode> Children
{
[IteratorStateMachine(typeof(<get_Children>d__49))]
get
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
<get_Children>d__49 <get_Children>d__ = new <get_Children>d__49(-2);
<get_Children>d__.<>4__this = this;
return <get_Children>d__;
}
}
public IEnumerable<JSONNode> DeepChildren
{
[IteratorStateMachine(typeof(<get_DeepChildren>d__51))]
get
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
<get_DeepChildren>d__51 <get_DeepChildren>d__ = new <get_DeepChildren>d__51(-2);
<get_DeepChildren>d__.<>4__this = this;
return <get_DeepChildren>d__;
}
}
public IEnumerable<KeyValuePair<string, JSONNode>> Linq => new LinqEnumerator(this);
public KeyEnumerator Keys => new KeyEnumerator(GetEnumerator());
public ValueEnumerator Values => new ValueEnumerator(GetEnumerator());
public virtual double AsDouble
{
get
{
double result = 0.0;
if (double.TryParse(Value, NumberStyles.Float, CultureInfo.InvariantCulture, out result))
{
return result;
}
return 0.0;
}
set
{
Value = value.ToString(CultureInfo.InvariantCulture);
}
}
public virtual int AsInt
{
get
{
return (int)AsDouble;
}
set
{
AsDouble = value;
}
}
public virtual float AsFloat
{
get
{
return (float)AsDouble;
}
set
{
AsDouble = value;
}
}
public virtual bool AsBool
{
get
{
bool result = false;
if (bool.TryParse(Value, out result))
{
return result;
}
return !string.IsNullOrEmpty(Value);
}
set
{
Value = (value ? "true" : "false");
}
}
public virtual long AsLong
{
get
{
long result = 0L;
if (long.TryParse(Value, out result))
{
return result;
}
return 0L;
}
set
{
Value = value.ToString();
}
}
public virtual ulong AsULong
{
get
{
ulong result = 0uL;
if (ulong.TryParse(Value, out result))
{
return result;
}
return 0uL;
}
set
{
Value = value.ToString();
}
}
public virtual JSONArray AsArray => this as JSONArray;
public virtual JSONObject AsObject => this as JSONObject;
public virtual decimal AsDecimal
{
get
{
if (!decimal.TryParse(Value, NumberStyles.Number, CultureInfo.InvariantCulture, out var result))
{
result = default(decimal);
}
return result;
}
set
{
Value = value.ToString();
}
}
public virtual char AsChar
{
get
{
if (IsString && Value.Length > 0)
{
return Value[0];
}
if (IsNumber)
{
return (char)AsInt;
}
return '\0';
}
set
{
if (IsString)
{
Value = value.ToString();
}
else if (IsNumber)
{
AsInt = value;
}
}
}
public virtual uint AsUInt
{
get
{
return (uint)AsDouble;
}
set
{
AsDouble = value;
}
}
public virtual byte AsByte
{
get
{
return (byte)AsInt;
}
set
{
AsInt = value;
}
}
public virtual sbyte AsSByte
{
get
{
return (sbyte)AsInt;
}
set
{
AsInt = value;
}
}
public virtual short AsShort
{
get
{
return (short)AsInt;
}
set
{
AsInt = value;
}
}
public virtual ushort AsUShort
{
get
{
return (ushort)AsInt;
}
set
{
AsInt = value;
}
}
public virtual DateTime AsDateTime
{
get
{
if (!DateTime.TryParse(Value, CultureInfo.InvariantCulture, DateTimeStyles.None, out var result))
{
result = new DateTime(0L);
}
return result;
}
set
{
Value = value.ToString(CultureInfo.InvariantCulture);
}
}
public virtual TimeSpan AsTimeSpan
{
get
{
if (!TimeSpan.TryParse(Value, out var result))
{
result = new TimeSpan(0L);
}
return result;
}
set
{
Value = value.ToString();
}
}
public virtual byte[] AsByteArray
{
get
{
if (IsNull || !IsArray)
{
return null;
}
int count = Count;
byte[] array = new byte[count];
for (int i = 0; i < count; i++)
{
array[i] = this[i].AsByte;
}
return array;
}
set
{
if (IsArray && value != null)
{
Clear();
for (int i = 0; i < value.Length; i++)
{
Add(value[i]);
}
}
}
}
public virtual List<byte> AsByteList
{
get
{
if (IsNull || !IsArray)
{
return null;
}
int count = Count;
List<byte> list = new List<byte>(count);
for (int i = 0; i < count; i++)
{
list.Add(this[i].AsByte);
}
return list;
}
set
{
if (IsArray && value != null)
{
Clear();
for (int i = 0; i < value.Count; i++)
{
Add(value[i]);
}
}
}
}
public virtual string[] AsStringArray
{
get
{
if (IsNull || !IsArray)
{
return null;
}
int count = Count;
string[] array = new string[count];
for (int i = 0; i < count; i++)
{
array[i] = this[i].Value;
}
return array;
}
set
{
if (IsArray && value != null)
{
Clear();
for (int i = 0; i < value.Length; i++)
{
Add(value[i]);
}
}
}
}
public virtual List<string> AsStringList
{
get
{
if (IsNull || !IsArray)
{
return null;
}
int count = Count;
List<string> list = new List<string>(count);
for (int i = 0; i < count; i++)
{
list.Add(this[i].Value);
}
return list;
}
set
{
if (IsArray && value != null)
{
Clear();
for (int i = 0; i < value.Count; i++)
{
Add(value[i]);
}
}
}
}
internal static string Escape(string aText)
{
StringBuilder escapeBuilder = EscapeBuilder;
escapeBuilder.Length = 0;
if (escapeBuilder.Capacity < aText.Length + aText.Length / 10)
{
escapeBuilder.Capacity = aText.Length + aText.Length / 10;
}
foreach (char c in aText)
{
switch (c)
{
case '\\':
escapeBuilder.Append("\\\\");
continue;
case '"':
escapeBuilder.Append("\\\"");
continue;
case '\n':
escapeBuilder.Append("\\n");
continue;
case '\r':
escapeBuilder.Append("\\r");
continue;
case '\t':
escapeBuilder.Append("\\t");
continue;
case '\b':
escapeBuilder.Append("\\b");
continue;
case '\f':
escapeBuilder.Append("\\f");
continue;
}
if (c < ' ' || (forceASCII && c > '\u007f'))
{
ushort num = c;
escapeBuilder.Append("\\u").Append(num.ToString("X4"));
}
else
{
escapeBuilder.Append(c);
}
}
string result = escapeBuilder.ToString();
escapeBuilder.Length = 0;
return result;
}
private static JSONNode ParseElement(string token, bool quoted)
{
if (quoted)
{
return token;
}
if (token.Length <= 5)
{
string text = token.ToLower();
if (text == "false" || text == "true")
{
return text == "true";
}
if (text == "null")
{
return JSONNull.CreateOrGet();
}
}
if (double.TryParse(token, NumberStyles.Float, CultureInfo.InvariantCulture, out var result))
{
return result;
}
return token;
}
public static JSONNode Parse(string aJSON)
{
Stack<JSONNode> stack = new Stack<JSONNode>();
JSONNode jSONNode = null;
int i = 0;
StringBuilder stringBuilder = new StringBuilder();
string aKey = "";
bool flag = false;
bool flag2 = false;
bool flag3 = false;
for (; i < aJSON.Length; i++)
{
switch (aJSON[i])
{
case '{':
if (flag)
{
stringBuilder.Append(aJSON[i]);
break;
}
stack.Push(new JSONObject());
if (jSONNode != null)
{
jSONNode.Add(aKey, stack.Peek());
}
aKey = "";
stringBuilder.Length = 0;
jSONNode = stack.Peek();
flag3 = false;
break;
case '[':
if (flag)
{
stringBuilder.Append(aJSON[i]);
break;
}
stack.Push(new JSONArray());
if (jSONNode != null)
{
jSONNode.Add(aKey, stack.Peek());
}
aKey = "";
stringBuilder.Length = 0;
jSONNode = stack.Peek();
flag3 = false;
break;
case ']':
case '}':
if (flag)
{
stringBuilder.Append(aJSON[i]);
break;
}
if (stack.Count == 0)
{
throw new Exception("JSON Parse: Too many closing brackets");
}
stack.Pop();
if (stringBuilder.Length > 0 || flag2)
{
jSONNode.Add(aKey, ParseElement(stringBuilder.ToString(), flag2));
}
if (jSONNode != null)
{
jSONNode.Inline = !flag3;
}
flag2 = false;
aKey = "";
stringBuilder.Length = 0;
if (stack.Count > 0)
{
jSONNode = stack.Peek();
}
break;
case ':':
if (flag)
{
stringBuilder.Append(aJSON[i]);
break;
}
aKey = stringBuilder.ToString();
stringBuilder.Length = 0;
flag2 = false;
break;
case '"':
flag = !flag;
flag2 = flag2 || flag;
break;
case ',':
if (flag)
{
stringBuilder.Append(aJSON[i]);
break;
}
if (stringBuilder.Length > 0 || flag2)
{
jSONNode.Add(aKey, ParseElement(stringBuilder.ToString(), flag2));
}
flag2 = false;
aKey = "";
stringBuilder.Length = 0;
flag2 = false;
break;
case '\n':
case '\r':
flag3 = true;
break;
case '\t':
case ' ':
if (flag)
{
stringBuilder.Append(aJSON[i]);
}
break;
case '\\':
i++;
if (flag)
{
char c = aJSON[i];
switch (c)
{
case 't':
stringBuilder.Append('\t');
break;
case 'r':
stringBuilder.Append('\r');
break;
case 'n':
stringBuilder.Append('\n');
break;
case 'b':
stringBuilder.Append('\b');
break;
case 'f':
stringBuilder.Append('\f');
break;
case 'u':
{
string s = aJSON.Substring(i + 1, 4);
stringBuilder.Append((char)int.Parse(s, NumberStyles.AllowHexSpecifier));
i += 4;
break;
}
default:
stringBuilder.Append(c);
break;
}
}
break;
case '/':
if (allowLineComments && !flag && i + 1 < aJSON.Length && aJSON[i + 1] == '/')
{
while (++i < aJSON.Length && aJSON[i] != '\n' && aJSON[i] != '\r')
{
}
}
else
{
stringBuilder.Append(aJSON[i]);
}
break;
default:
stringBuilder.Append(aJSON[i]);
break;
case '\ufeff':
break;
}
}
if (flag)
{
throw new Exception("JSON Parse: Quotation marks seems to be messed up.");
}
if (jSONNode == null)
{
return ParseElement(stringBuilder.ToString(), flag2);
}
return jSONNode;
}
public virtual void Add(string aKey, JSONNode aItem)
{
}
public virtual void Add(JSONNode aItem)
{
Add("", aItem);
}
public virtual JSONNode Remove(string aKey)
{
return null;
}
public virtual JSONNode Remove(int aIndex)
{
return null;
}
public virtual JSONNode Remove(JSONNode aNode)
{
return aNode;
}
public virtual void Clear()
{
}
public virtual JSONNode Clone()
{
return null;
}
public virtual bool HasKey(string aKey)
{
return false;
}
public virtual JSONNode GetValueOrDefault(string aKey, JSONNode aDefault)
{
return aDefault;
}
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder();
WriteToStringBuilder(stringBuilder, 0, 0, JSONTextMode.Compact);
return stringBuilder.ToString();
}
public virtual string ToString(int aIndent)
{
StringBuilder stringBuilder = new StringBuilder();
WriteToStringBuilder(stringBuilder, 0, aIndent, JSONTextMode.Indent);
return stringBuilder.ToString();
}
internal abstract void WriteToStringBuilder(StringBuilder aSB, int aIndent, int aIndentInc, JSONTextMode aMode);
public abstract Enumerator GetEnumerator();
public static implicit operator JSONNode(string s)
{
return (s == null) ? ((JSONNode)JSONNull.CreateOrGet()) : ((JSONNode)new JSONString(s));
}
public static implicit operator string(JSONNode d)
{
return (d == null) ? null : d.Value;
}
public static implicit operator JSONNode(double n)
{
return new JSONNumber(n);
}
public static implicit operator double(JSONNode d)
{
return (d == null) ? 0.0 : d.AsDouble;
}
public static implicit operator JSONNode(float n)
{
return new JSONNumber(n);
}
public static implicit operator float(JSONNode d)
{
return (d == null) ? 0f : d.AsFloat;
}
public static implicit operator JSONNode(int n)
{
return new JSONNumber(n);
}
public static implicit operator int(JSONNode d)
{
return (!(d == null)) ? d.AsInt : 0;
}
public static implicit operator JSONNode(long n)
{
if (longAsString)
{
return new JSONString(n.ToString());
}
return new JSONNumber(n);
}
public static implicit operator long(JSONNode d)
{
return (d == null) ? 0 : d.AsLong;
}
public static implicit operator JSONNode(ulong n)
{
if (longAsString)
{
return new JSONString(n.ToString());
}
return new JSONNumber(n);
}
public static implicit operator ulong(JSONNode d)
{
return (d == null) ? 0 : d.AsULong;
}
public static implicit operator JSONNode(bool b)
{
return new JSONBool(b);
}
public static implicit operator bool(JSONNode d)
{
return !(d == null) && d.AsBool;
}
public static implicit operator JSONNode(KeyValuePair<string, JSONNode> aKeyValue)
{
return aKeyValue.Value;
}
public static bool operator ==(JSONNode a, object b)
{
if ((object)a == b)
{
return true;
}
bool flag = a is JSONNull || (object)a == null || a is JSONLazyCreator;
bool flag2 = b is JSONNull || b == null || b is JSONLazyCreator;
if (flag && flag2)
{
return true;
}
return !flag && a.Equals(b);
}
public static bool operator !=(JSONNode a, object b)
{
return !(a == b);
}
public override bool Equals(object obj)
{
return (object)this == obj;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
public abstract void SerializeBinary(BinaryWriter aWriter);
public void SaveToBinaryStream(Stream aData)
{
BinaryWriter aWriter = new BinaryWriter(aData);
SerializeBinary(aWriter);
}
public void SaveToCompressedStream(Stream aData)
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
public void SaveToCompressedFile(string aFileName)
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
public string SaveToCompressedBase64()
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
public void SaveToBinaryFile(string aFileName)
{
Directory.CreateDirectory(new FileInfo(aFileName).Directory.FullName);
using FileStream aData = File.OpenWrite(aFileName);
SaveToBinaryStream(aData);
}
public string SaveToBinaryBase64()
{
using MemoryStream memoryStream = new MemoryStream();
SaveToBinaryStream(memoryStream);
memoryStream.Position = 0L;
return Convert.ToBase64String(memoryStream.ToArray());
}
public static JSONNode DeserializeBinary(BinaryReader aReader)
{
JSONNodeType jSONNodeType = (JSONNodeType)aReader.ReadByte();
switch (jSONNodeType)
{
case JSONNodeType.Array:
{
int num2 = aReader.ReadInt32();
JSONArray jSONArray = new JSONArray();
for (int j = 0; j < num2; j++)
{
jSONArray.Add(DeserializeBinary(aReader));
}
return jSONArray;
}
case JSONNodeType.Object:
{
int num = aReader.ReadInt32();
JSONObject jSONObject = new JSONObject();
for (int i = 0; i < num; i++)
{
string aKey = aReader.ReadString();
JSONNode aItem = DeserializeBinary(aReader);
jSONObject.Add(aKey, aItem);
}
return jSONObject;
}
case JSONNodeType.String:
return new JSONString(aReader.ReadString());
case JSONNodeType.Number:
return new JSONNumber(aReader.ReadDouble());
case JSONNodeType.Boolean:
return new JSONBool(aReader.ReadBoolean());
case JSONNodeType.NullValue:
return JSONNull.CreateOrGet();
default:
throw new Exception("Error deserializing JSON. Unknown tag: " + jSONNodeType);
}
}
public static JSONNode LoadFromCompressedFile(string aFileName)
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
public static JSONNode LoadFromCompressedStream(Stream aData)
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
public static JSONNode LoadFromCompressedBase64(string aBase64)
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
public static JSONNode LoadFromBinaryStream(Stream aData)
{
using BinaryReader aReader = new BinaryReader(aData);
return DeserializeBinary(aReader);
}
public static JSONNode LoadFromBinaryFile(string aFileName)
{
using FileStream aData = File.OpenRead(aFileName);
return LoadFromBinaryStream(aData);
}
public static JSONNode LoadFromBinaryBase64(string aBase64)
{
byte[] buffer = Convert.FromBase64String(aBase64);
MemoryStream memoryStream = new MemoryStream(buffer);
memoryStream.Position = 0L;
return LoadFromBinaryStream(memoryStream);
}
public static implicit operator JSONNode(decimal aDecimal)
{
return new JSONString(aDecimal.ToString());
}
public static implicit operator decimal(JSONNode aNode)
{
return aNode.AsDecimal;
}
public static implicit operator JSONNode(char aChar)
{
return new JSONString(aChar.ToString());
}
public static implicit operator char(JSONNode aNode)
{
return aNode.AsChar;
}
public static implicit operator JSONNode(uint aUInt)
{
return new JSONNumber(aUInt);
}
public static implicit operator uint(JSONNode aNode)
{
return aNode.AsUInt;
}
public static implicit operator JSONNode(byte aByte)
{
return new JSONNumber((int)aByte);
}
public static implicit operator byte(JSONNode aNode)
{
return aNode.AsByte;
}
public static implicit operator JSONNode(sbyte aSByte)
{
return new JSONNumber(aSByte);
}
public static implicit operator sbyte(JSONNode aNode)
{
return aNode.AsSByte;
}
public static implicit operator JSONNode(short aShort)
{
return new JSONNumber(aShort);
}
public static implicit operator short(JSONNode aNode)
{
return aNode.AsShort;
}
public static implicit operator JSONNode(ushort aUShort)
{
return new JSONNumber((int)aUShort);
}
public static implicit operator ushort(JSONNode aNode)
{
return aNode.AsUShort;
}
public static implicit operator JSONNode(DateTime aDateTime)
{
return new JSONString(aDateTime.ToString(CultureInfo.InvariantCulture));
}
public static implicit operator DateTime(JSONNode aNode)
{
return aNode.AsDateTime;
}
public static implicit operator JSONNode(TimeSpan aTimeSpan)
{
return new JSONString(aTimeSpan.ToString());
}
public static implicit operator TimeSpan(JSONNode aNode)
{
return aNode.AsTimeSpan;
}
public static implicit operator JSONNode(byte[] aByteArray)
{
return new JSONArray
{
AsByteArray = aByteArray
};
}
public static implicit operator byte[](JSONNode aNode)
{
return aNode.AsByteArray;
}
public static implicit operator JSONNode(List<byte> aByteList)
{
return new JSONArray
{
AsByteList = aByteList
};
}
public static implicit operator List<byte>(JSONNode aNode)
{
return aNode.AsByteList;
}
public static implicit operator JSONNode(string[] aStringArray)
{
return new JSONArray
{
AsStringArray = aStringArray
};
}
public static implicit operator string[](JSONNode aNode)
{
return aNode.AsStringArray;
}
public static implicit operator JSONNode(List<string> aStringList)
{
return new JSONArray
{
AsStringList = aStringList
};
}
public static implicit operator List<string>(JSONNode aNode)
{
return aNode.AsStringList;
}
public static implicit operator JSONNode(int? aValue)
{
if (!aValue.HasValue)
{
return JSONNull.CreateOrGet();
}
return new JSONNumber(aValue.Value);
}
public static implicit operator int?(JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
{
return null;
}
return aNode.AsInt;
}
public static implicit operator JSONNode(float? aValue)
{
if (!aValue.HasValue)
{
return JSONNull.CreateOrGet();
}
return new JSONNumber(aValue.Value);
}
public static implicit operator float?(JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
{
return null;
}
return aNode.AsFloat;
}
public static implicit operator JSONNode(double? aValue)
{
if (!aValue.HasValue)
{
return JSONNull.CreateOrGet();
}
return new JSONNumber(aValue.Value);
}
public static implicit operator double?(JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
{
return null;
}
return aNode.AsDouble;
}
public static implicit operator JSONNode(bool? aValue)
{
if (!aValue.HasValue)
{
return JSONNull.CreateOrGet();
}
return new JSONBool(aValue.Value);
}
public static implicit operator bool?(JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
{
return null;
}
return aNode.AsBool;
}
public static implicit operator JSONNode(long? aValue)
{
if (!aValue.HasValue)
{
return JSONNull.CreateOrGet();
}
return new JSONNumber(aValue.Value);
}
public static implicit operator long?(JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
{
return null;
}
return aNode.AsLong;
}
public static implicit operator JSONNode(short? aValue)
{
if (!aValue.HasValue)
{
return JSONNull.CreateOrGet();
}
return new JSONNumber(aValue.Value);
}
public static implicit operator short?(JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
{
return null;
}
return aNode.AsShort;
}
private static JSONNode GetContainer(JSONContainerType aType)
{
if (aType == JSONContainerType.Array)
{
return new JSONArray();
}
return new JSONObject();
}
public static implicit operator JSONNode(Vector2 aVec)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
JSONNode container = GetContainer(VectorContainerType);
container.WriteVector2(aVec);
return container;
}
public static implicit operator JSONNode(Vector3 aVec)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
JSONNode container = GetContainer(VectorContainerType);
container.WriteVector3(aVec);
return container;
}
public static implicit operator JSONNode(Vector4 aVec)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
JSONNode container = GetContainer(VectorContainerType);
container.WriteVector4(aVec);
return container;
}
public static implicit operator JSONNode(Color aCol)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
JSONNode container = GetContainer(ColorContainerType);
container.WriteColor(aCol);
return container;
}
public static implicit operator JSONNode(Color32 aCol)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
JSONNode container = GetContainer(ColorContainerType);
container.WriteColor32(aCol);
return container;
}
public static implicit operator JSONNode(Quaternion aRot)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
JSONNode container = GetContainer(QuaternionContainerType);
container.WriteQuaternion(aRot);
return container;
}
public static implicit operator JSONNode(Rect aRect)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
JSONNode container = GetContainer(RectContainerType);
container.WriteRect(aRect);
return container;
}
public static implicit operator JSONNode(RectOffset aRect)
{
JSONNode container = GetContainer(RectContainerType);
container.WriteRectOffset(aRect);
return container;
}
public static implicit operator JSONNode(Matrix4x4 aMatrix)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
JSONNode container = GetContainer(RectContainerType);
container.WriteMatrix(aMatrix);
return container;
}
public static implicit operator Vector2(JSONNode aNode)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
return aNode.ReadVector2();
}
public static implicit operator Vector3(JSONNode aNode)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
return aNode.ReadVector3();
}
public static implicit operator Vector4(JSONNode aNode)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
return aNode.ReadVector4();
}
public static implicit operator Color(JSONNode aNode)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
return aNode.ReadColor();
}
public static implicit operator Color32(JSONNode aNode)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
return aNode.ReadColor32();
}
public static implicit operator Quaternion(JSONNode aNode)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
return aNode.ReadQuaternion();
}
public static implicit operator Rect(JSONNode aNode)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
return aNode.ReadRect();
}
public static implicit operator RectOffset(JSONNode aNode)
{
return aNode.ReadRectOffset();
}
public static implicit operator Matrix4x4(JSONNode aNode)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
return aNode.ReadMatrix();
}
public Vector2 ReadVector2(Vector2 aDefault)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
return new Vector2(this["x"].AsFloat, this["y"].AsFloat);
}
if (IsArray)
{
return new Vector2(this[0].AsFloat, this[1].AsFloat);
}
return aDefault;
}
public Vector2 ReadVector2(string aXName, string aYName)
{
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
return new Vector2(this[aXName].AsFloat, this[aYName].AsFloat);
}
return Vector2.zero;
}
public Vector2 ReadVector2()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
return ReadVector2(Vector2.zero);
}
public JSONNode WriteVector2(Vector2 aVec, string aXName = "x", string aYName = "y")
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
Inline = true;
this[aXName].AsFloat = aVec.x;
this[aYName].AsFloat = aVec.y;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = aVec.x;
this[1].AsFloat = aVec.y;
}
return this;
}
public Vector3 ReadVector3(Vector3 aDefault)
{
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
return new Vector3(this["x"].AsFloat, this["y"].AsFloat, this["z"].AsFloat);
}
if (IsArray)
{
return new Vector3(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat);
}
return aDefault;
}
public Vector3 ReadVector3(string aXName, string aYName, string aZName)
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
return new Vector3(this[aXName].AsFloat, this[aYName].AsFloat, this[aZName].AsFloat);
}
return Vector3.zero;
}
public Vector3 ReadVector3()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
return ReadVector3(Vector3.zero);
}
public JSONNode WriteVector3(Vector3 aVec, string aXName = "x", string aYName = "y", string aZName = "z")
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
Inline = true;
this[aXName].AsFloat = aVec.x;
this[aYName].AsFloat = aVec.y;
this[aZName].AsFloat = aVec.z;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = aVec.x;
this[1].AsFloat = aVec.y;
this[2].AsFloat = aVec.z;
}
return this;
}
public Vector4 ReadVector4(Vector4 aDefault)
{
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
return new Vector4(this["x"].AsFloat, this["y"].AsFloat, this["z"].AsFloat, this["w"].AsFloat);
}
if (IsArray)
{
return new Vector4(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat, this[3].AsFloat);
}
return aDefault;
}
public Vector4 ReadVector4()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
return ReadVector4(Vector4.zero);
}
public JSONNode WriteVector4(Vector4 aVec)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
Inline = true;
this["x"].AsFloat = aVec.x;
this["y"].AsFloat = aVec.y;
this["z"].AsFloat = aVec.z;
this["w"].AsFloat = aVec.w;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = aVec.x;
this[1].AsFloat = aVec.y;
this[2].AsFloat = aVec.z;
this[3].AsFloat = aVec.w;
}
return this;
}
public Color ReadColor(Color aDefault)
{
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
return new Color(this["r"].AsFloat, this["g"].AsFloat, this["b"].AsFloat, HasKey("a") ? this["a"].AsFloat : ColorDefaultAlpha);
}
if (IsArray)
{
return new Color(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat, (Count > 3) ? this[3].AsFloat : ColorDefaultAlpha);
}
return aDefault;
}
public Color ReadColor()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
return ReadColor(Color.clear);
}
public JSONNode WriteColor(Color aCol)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
Inline = true;
this["r"].AsFloat = aCol.r;
this["g"].AsFloat = aCol.g;
this["b"].AsFloat = aCol.b;
this["a"].AsFloat = aCol.a;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = aCol.r;
this[1].AsFloat = aCol.g;
this[2].AsFloat = aCol.b;
this[3].AsFloat = aCol.a;
}
return this;
}
public Color32 ReadColor32(Color32 aDefault)
{
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
return new Color32((byte)this["r"].AsInt, (byte)this["g"].AsInt, (byte)this["b"].AsInt, (byte)(HasKey("a") ? this["a"].AsInt : Color32DefaultAlpha));
}
if (IsArray)
{
return new Color32((byte)this[0].AsInt, (byte)this[1].AsInt, (byte)this[2].AsInt, (byte)((Count > 3) ? this[3].AsInt : Color32DefaultAlpha));
}
return aDefault;
}
public Color32 ReadColor32()
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
return ReadColor32(default(Color32));
}
public JSONNode WriteColor32(Color32 aCol)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
Inline = true;
this["r"].AsInt = aCol.r;
this["g"].AsInt = aCol.g;
this["b"].AsInt = aCol.b;
this["a"].AsInt = aCol.a;
}
else if (IsArray)
{
Inline = true;
this[0].AsInt = aCol.r;
this[1].AsInt = aCol.g;
this[2].AsInt = aCol.b;
this[3].AsInt = aCol.a;
}
return this;
}
public Quaternion ReadQuaternion(Quaternion aDefault)
{
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
return new Quaternion(this["x"].AsFloat, this["y"].AsFloat, this["z"].AsFloat, this["w"].AsFloat);
}
if (IsArray)
{
return new Quaternion(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat, this[3].AsFloat);
}
return aDefault;
}
public Quaternion ReadQuaternion()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
return ReadQuaternion(Quaternion.identity);
}
public JSONNode WriteQuaternion(Quaternion aRot)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
Inline = true;
this["x"].AsFloat = aRot.x;
this["y"].AsFloat = aRot.y;
this["z"].AsFloat = aRot.z;
this["w"].AsFloat = aRot.w;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = aRot.x;
this[1].AsFloat = aRot.y;
this[2].AsFloat = aRot.z;
this[3].AsFloat = aRot.w;
}
return this;
}
public Rect ReadRect(Rect aDefault)
{
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
if (IsObject)
{
return new Rect(this["x"].AsFloat, this["y"].AsFloat, this["width"].AsFloat, this["height"].AsFloat);
}
if (IsArray)
{
return new Rect(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat, this[3].AsFloat);
}
return aDefault;
}
public Rect ReadRect()
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
return ReadRect(default(Rect));
}
public JSONNode WriteRect(Rect aRect)
{
if (IsObject)
{
Inline = true;
this["x"].AsFloat = ((Rect)(ref aRect)).x;
this["y"].AsFloat = ((Rect)(ref aRect)).y;
this["width"].AsFloat = ((Rect)(ref aRect)).width;
this["height"].AsFloat = ((Rect)(ref aRect)).height;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = ((Rect)(ref aRect)).x;
this[1].AsFloat = ((Rect)(ref aRect)).y;
this[2].AsFloat = ((Rect)(ref aRect)).width;
this[3].AsFloat = ((Rect)(ref aRect)).height;
}
return this;
}
public RectOffset ReadRectOffset(RectOffset aDefault)
{
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Expected O, but got Unknown
if (this is JSONObject)
{
return new RectOffset(this["left"].AsInt, this["right"].AsInt, this["top"].AsInt, this["bottom"].AsInt);
}
if (this is JSONArray)
{
return new RectOffset(this[0].AsInt, this[1].AsInt, this[2].AsInt, this[3].AsInt);
}
return aDefault;
}
public RectOffset ReadRectOffset()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
return ReadRectOffset(new RectOffset());
}
public JSONNode WriteRectOffset(RectOffset aRect)
{
if (IsObject)
{
Inline = true;
this["left"].AsInt = aRect.left;
this["right"].AsInt = aRect.right;
this["top"].AsInt = aRect.top;
this["bottom"].AsInt = aRect.bottom;
}
else if (IsArray)
{
Inline = true;
this[0].AsInt = aRect.left;
this[1].AsInt = aRect.right;
this[2].AsInt = aRect.top;
this[3].AsInt = aRect.bottom;
}
return this;
}
public Matrix4x4 ReadMatrix()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
Matrix4x4 identity = Matrix4x4.identity;
if (IsArray)
{
for (int i = 0; i < 16; i++)
{
((Matrix4x4)(ref identity))[i] = this[i].AsFloat;
}
}
return identity;
}
public JSONNode WriteMatrix(Matrix4x4 aMatrix)
{
if (IsArray)
{
Inline = true;
for (int i = 0; i < 16; i++)
{
this[i].AsFloat = ((Matrix4x4)(ref aMatrix))[i];
}
}
return this;
}
}
public class JSONArray : JSONNode
{
[CompilerGenerated]
private sealed class <get_Children>d__18 : IEnumerable<JSONNode>, IEnumerable, IEnumerator<JSONNode>, IDisposable, IEnumerator
{
private int <>1__state;
private JSONNode <>2__current;
private int <>l__initialThreadId;
public JSONArray <>4__this;
private List<JSONNode>.Enumerator <>s__1;
private JSONNode <N>5__2;
JSONNode IEnumerator<JSONNode>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <get_Children>d__18(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || num == 1)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<>s__1 = default(List<JSONNode>.Enumerator);
<N>5__2 = null;
<>1__state = -2;
}
private bool MoveNext()
{
try
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>s__1 = <>4__this.m_List.GetEnumerator();
<>1__state = -3;
break;
case 1:
<>1__state = -3;
<N>5__2 = null;
break;
}
if (<>s__1.MoveNext())
{
<N>5__2 = <>s__1.Current;
<>2__current = <N>5__2;
<>1__state = 1;
return true;
}
<>m__Finally1();
<>s__1 = default(List<JSONNode>.Enumerator);
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
((IDisposable)<>s__1).Dispose();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<JSONNode> IEnumerable<JSONNode>.GetEnumerator()
{
<get_Children>d__18 result;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
result = this;
}
else
{
result = new <get_Children>d__18(0)
{
<>4__this = <>4__this
};
}
return result;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<JSONNode>)this).GetEnumerator();
}
}
private readonly List<JSONNode> m_List = new List<JSONNode>();
private bool inline;
public override bool Inline
{
get
{
return inline;
}
set
{
inline = value;
}
}
public override JSONNodeType Tag => JSONNodeType.Array;
public override bool IsArray => true;
public override JSONNode this[int aIndex]
{
get
{
if (aIndex < 0 || aIndex >= m_List.Count)
{
return new JSONLazyCreator(this);
}
return m_List[aIndex];
}
set
{
if (value == null)
{
value = JSONNull.CreateOrGet();
}
if (aIndex < 0 || aIndex >= m_List.Count)
{
m_List.Add(value);
}
else
{
m_List[aIndex] = value;
}
}
}
public override JSONNode this[string aKey]
{
get
{
return new JSONLazyCreator(this);
}
set
{
if (value == null)
{
value = JSONNull.CreateOrGet();
}
m_List.Add(value);
}
}
public override int Count => m_List.Count;
public override IEnumerable<JSONNode> Children
{
[IteratorStateMachine(typeof(<get_Children>d__18))]
get
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
<get_Children>d__18 <get_Children>d__ = new <get_Children>d__18(-2);
<get_Children>d__.<>4__this = this;
return <get_Children>d__;
}
}
public override Enumerator GetEnumerator()
{
return new Enumerator(m_List.GetEnumerator());
}
public override void Add(string aKey, JSONNode aItem)
{
if (aItem == null)
{
aItem = JSONNull.CreateOrGet();
}
m_List.Add(aItem);
}
public override JSONNode Remove(int aIndex)
{
if (aIndex < 0 || aIndex >= m_List.Count)
{
return null;
}
JSONNode result = m_List[aIndex];
m_List.RemoveAt(aIndex);
return result;
}
public override JSONNode Remove(JSONNode aNode)
{
m_List.Remove(aNode);
return aNode;
}
public override void Clear()
{
m_List.Clear();
}
public override JSONNode Clone()
{
JSONArray jSONArray = new JSONArray();
jSONArray.m_List.Capacity = m_List.Capacity;
foreach (JSONNode item in m_List)
{
if (item != null)
{
jSONArray.Add(item.Clone());
}
else
{
jSONArray.Add(null);
}
}
return jSONArray;
}
internal override void WriteToStringBuilder(StringBuilder aSB, int aIndent, int aIndentInc, JSONTextMode aMode)
{
aSB.Append('[');
int count = m_List.Count;
if (inline)
{
aMode = JSONTextMode.Compact;
}
for (int i = 0; i < count; i++)
{
if (i > 0)
{
aSB.Append(',');
}
if (aMode == JSONTextMode.Indent)
{
aSB.AppendLine();
}
if (aMode == JSONTextMode.Indent)
{
aSB.Append(' ', aIndent + aIndentInc);
}
m_List[i].WriteToStringBuilder(aSB, aIndent + aIndentInc, aIndentInc, aMode);
}
if (aMode == JSONTextMode.Indent)
{
aSB.AppendLine().Append(' ', aIndent);
}
aSB.Append(']');
}
public override void SerializeBinary(BinaryWriter aWriter)
{
aWriter.Write((byte)1);
aWriter.Write(m_List.Count);
for (int i = 0; i < m_List.Count; i++)
{
m_List[i].SerializeBinary(aWriter);
}
}
}
public class JSONObject : JSONNode
{
[CompilerGenerated]
private sealed class <get_Children>d__18 : IEnumerable<JSONNode>, IEnumerable, IEnumerator<JSONNode>, IDisposable, IEnumerator
{
private int <>1__state;
private JSONNode <>2__current;
private int <>l__initialThreadId;
public JSONObject <>4__this;
private Dictionary<string, JSONNode>.Enumerator <>s__1;
private KeyValuePair<string, JSONNode> <N>5__2;
JSONNode IEnumerator<JSONNode>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <get_Children>d__18(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || num == 1)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<>s__1 = default(Dictionary<string, JSONNode>.Enumerator);
<N>5__2 = default(KeyValuePair<string, JSONNode>);
<>1__state = -2;
}
private bool MoveNext()
{
try
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>s__1 = <>4__this.m_Dict.GetEnumerator();
<>1__state = -3;
break;
case 1:
<>1__state = -3;
<N>5__2 = default(KeyValuePair<string, JSONNode>);
break;
}
if (<>s__1.MoveNext())
{
<N>5__2 = <>s__1.Current;
<>2__current = <N>5__2.Value;
<>1__state = 1;
return true;
}
<>m__Finally1();
<>s__1 = default(Dictionary<string, JSONNode>.Enumerator);
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
((IDisposable)<>s__1).Dispose();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<JSONNode> IEnumerable<JSONNode>.GetEnumerator()
{
<get_Children>d__18 result;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
result = this;
}
else
{
result = new <get_Children>d__18(0)
{
<>4__this = <>4__this
};
}
return result;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<JSONNode>)this).GetEnumerator();
}
}
private readonly Dictionary<string, JSONNode> m_Dict = new Dictionary<string, JSONNode>();
private bool inline;
public override bool Inline
{
get
{
return inline;
}
set
{
inline = value;
}
}
public override JSONNodeType Tag => JSONNodeType.Object;
public override bool IsObject => true;
public override JSONNode this[string aKey]
{
get
{
if (m_Dict.ContainsKey(aKey))
{
return m_Dict[aKey];
}
return new JSONLazyCreator(this, aKey);
}
set
{
if (value == null)
{
value = JSONNull.CreateOrGet();
}
if (m_Dict.ContainsKey(aKey))
{
m_Dict[aKey] = value;
}
else
{
m_Dict.Add(aKey, value);
}
}
}
public override JSONNode this[int aIndex]
{
get
{
if (aIndex < 0 || aIndex >= m_Dict.Count)
{
return null;
}
return m_Dict.ElementAt(aIndex).Value;
}
set
{
if (value == null)
{
value = JSONNull.CreateOrGet();
}
if (aIndex >= 0 && aIndex < m_Dict.Count)
{
string key = m_Dict.ElementAt(aIndex).Key;
m_Dict[key] = value;
}
}
}
public override int Count => m_Dict.Count;
public override IEnumerable<JSONNode> Children
{
[IteratorStateMachine(typeof(<get_Children>d__18))]
get
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
<get_Children>d__18 <get_Children>d__ = new <get_Children>d__18(-2);
<get_Children>d__.<>4__this = this;
return <get_Children>d__;
}
}
public override Enumerator GetEnumerator()
{
return new Enumerator(m_Dict.GetEnumerator());
}
public override void Add(string aKey, JSONNode aItem)
{
if (aItem == null)
{
aItem = JSONNull.CreateOrGet();
}
if (aKey != null)
{
if (m_Dict.ContainsKey(aKey))
{
m_Dict[aKey] = aItem;
}
else
{
m_Dict.Add(aKey, aItem);
}
}
else
{
m_Dict.Add(Guid.NewGuid().ToString(), aItem);
}
}
public override JSONNode Remove(string aKey)
{
if (!m_Dict.ContainsKey(aKey))
{
return null;
}
JSONNode result = m_Dict[aKey];
m_Dict.Remove(aKey);
return result;
}
public override JSONNode Remove(int aIndex)
{
if (aIndex < 0 || aIndex >= m_Dict.Count)
{
return null;
}
KeyValuePair<string, JSONNode> keyValuePair = m_Dict.ElementAt(aIndex);
m_Dict.Remove(keyValuePair.Key);
return keyValuePair.Value;
}
public override JSONNode Remove(JSONNode aNode)
{
try
{
KeyValuePair<string, JSONNode> keyValuePair = m_Dict.Where((KeyValuePair<string, JSONNode> k) => k.Value == aNode).First();
m_Dict.Remove(keyValuePair.Key);
return aNode;
}
catch
{
return null;
}
}
public override void Clear()
{
m_Dict.Clear();
}
public override JSONNode Clone()
{
JSONObject jSONObject = new JSONObject();
foreach (KeyValuePair<string, JSONNode> item in m_Dict)
{
jSONObject.Add(item.Key, item.Value.Clone());
}
return jSONObject;
}
public override bool HasKey(string aKey)
{
return m_Dict.ContainsKey(aKey);
}
public override JSONNode GetValueOrDefault(string aKey, JSONNode aDefault)
{
if (m_Dict.TryGetValue(aKey, out var value))
{
return value;
}
return aDefault;
}
internal override void WriteToStringBuilder(StringBuilder aSB, int aIndent, int aIndentInc, JSONTextMode aMode)
{
aSB.Append('{');
if (Children.Count() != 0)
{
bool flag = true;
if (inline)
{
aMode = JSONTextMode.Compact;
}
foreach (KeyValuePair<string, JSONNode> item in m_Dict)
{
if (!flag)
{
aSB.Append(',');
}
flag = false;
if (aMode == JSONTextMode.Indent)
{
aSB.AppendLine();
}
if (aMode == JSONTextMode.Indent)
{
aSB.Append(' ', aIndent + aIndentInc);
}
aSB.Append('"').Append(JSONNode.Escape(item.Key)).Append('"');
if (aMode == JSONTextMode.Compact)
{
aSB.Append(':');
}
else
{
aSB.Append(": ");
}
item.Value.WriteToStringBuilder(aSB, aIndent + aIndentInc, aIndentInc, aMode);
}
if (aMode == JSONTextMode.Indent)
{
aSB.AppendLine().Append(' ', aIndent);
}
}
aSB.Append('}');
}
public override void SerializeBinary(BinaryWriter aWriter)
{
aWriter.Write((byte)2);
aWriter.Write(m_Dict.Count);
foreach (string key in m_Dict.Keys)
{
aWriter.Write(key);
m_Dict[key].SerializeBinary(aWriter);
}
}
}
public class JSONString : JSONNode
{
private string m_Data;
public override JSONNodeType Tag => JSONNodeType.String;
public override bool IsString => true;
public override string Value
{
get
{
return m_Data;
}
set
{
m_Data = value;
}
}
public JSONString(string aData)
{
m_Data = aData;
}
public override Enumerator GetEnumerator()
{
return default(Enumerator);
}
public override JSONNode Clone()
{
return new JSONString(m_Data);
}
internal override void WriteToStringBuilder(StringBuilder aSB, int aIndent, int aIndentInc, JSONTextMode aMode)
{
aSB.Append('"').Append(JSONNode.Escape(m_Data)).Append('"');
}
public override bool Equals(object obj)
{
if (base.Equals(obj))
{
return true;
}
if (obj is string text)
{
return m_Data == text;
}
JSONString jSONString = obj as JSONString;
if (jSONString != null)
{
return m_Data == jSONString.m_Data;
}
return false;
}
public override int GetHashCode()
{
return m_Data.GetHashCode();
}
public override void Clear()
{
m_Data = "";
}
public override void SerializeBinary(BinaryWriter aWriter)
{
aWriter.Write((byte)3);
aWriter.Write(m_Data);
}
}
public class JSONNumber : JSONNode
{
private double m_Data;
public override JSONNodeType Tag => JSONNodeType.Number;
public override bool IsNumber => true;
public override string Value
{
get
{
return m_Data.ToString(CultureInfo.InvariantCulture);
}
set
{
if (double.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var result))
{
m_Data = result;
}
}
}
public override double AsDouble
{
get
{
return m_Data;
}
set
{
m_Data = value;
}
}
public override long AsLong
{
get
{
return (long)m_Data;
}
set
{
m_Data = value;
}
}
public override ulong AsULong
{
get
{
return (ulong)m_Data;
}
set
{
m_Data = value;
}
}
public JSONNumber(double aData)
{
m_Data = aData;
}
public JSONNumber(string value)
{
Value = value;
}
public override Enumerator GetEnumerator()
{
return default(Enumerator);
}
public override JSONNode Clone()
{
return new JSONNumber(m_Data);
}
internal override void WriteToStringBuilder(StringBuilder aSB, int aIndent, int aIndentInc, JSONTextMode aMode)
{
aSB.Append(m_Data.ToString("R", CultureInfo.InvariantCulture));
}
public static bool IsNumeric(object value)
{
return value is int || value is uint || value is float || value is double || value is decimal || value is long || value is ulong || value is short || value is ushort || value is sbyte || value is byte;
}
public override bool Equals(object obj)
{
if (obj == null)
{
return false;
}
if (base.Equals(obj))
{
return true;
}
JSONNumber jSONNumber = obj as JSONNumber;
if (jSONNumber != null)
{
return m_Data == jSONNumber.m_Data;
}
if (IsNumeric(obj))
{
return Convert.ToDouble(obj) == m_Data;
}
return false;
}
public override int GetHashCode()
{
return m_Data.GetHashCode();
}
public override void Clear()
{
m_Data = 0.0;
}
public override void SerializeBinary(BinaryWriter aWriter)
{
aWriter.Write((byte)4);
aWriter.Write(m_Data);
}
}
public class JSONBool : JSONNode
{
private bool m_Data;
public override JSONNodeType Tag => JSONNodeType.Boolean;
public override bool IsBoolean => true;
public override string Value
{
get
{
return m_Data.ToString();
}
set
{
if (bool.TryParse(value, out var result))
{
m_Data = result;
}
}
}
public override bool AsBool
{
get
{
return m_Data;
}
set
{
m_Data = value;
}
}
public JSONBool(bool aData)
{
m_Data = aData;
}
public JSONBool(string aData)
{
Value = aData;
}
public override Enumerator GetEnumerator()
{
return default(Enumerator);
}
public override JSONNode Clone()
{
return new JSONBool(m_Data);
}
internal override void WriteToStringBuilder(StringBuilder aSB, int aIndent, int aIndentInc, JSONTextMode aMode)
{
aSB.Append(m_Data ? "true" : "false");
}
public override bool Equals(object obj)
{
if (obj == null)
{
return false;
}
if (obj is bool)
{
return m_Data == (bool)obj;
}
return false;
}
public override int GetHashCode()
{
return m_Data.GetHashCode();
}
public override void Clear()
{
m_Data = false;
}
public override void SerializeBinary(BinaryWriter aWriter)
{
aWriter.Write((byte)6);
aWriter.Write(m_Data);
}
}
public class JSONNull : JSONNode
{
private static readonly JSONNull m_StaticInstance = new JSONNull();
public static bool reuseSameInstance = true;
public override JSONNodeType Tag => JSONNodeType.NullValue;
public override bool IsNull => true;
public override string Value
{
get
{
return "null";
}
set
{
}
}
public override bool AsBool
{
get
{
return false;
}
set
{
}
}
private JSONNull()
{
}
public static JSONNull CreateOrGet()
{
if (reuseSameInstance)
{
return m_StaticInstance;
}
return new JSONNull();
}
public override Enumerator GetEnumerator()
{
return default(Enumerator);
}
public override JSONNode Clone()
{
return CreateOrGet();
}
public override bool Equals(object obj)
{
if ((object)this == obj)
{
return true;
}
return obj is JSONNull;
}
public override int GetHashCode()
{
return 0;
}
internal override void WriteToStringBuilder(StringBuilder aSB, int aIndent, int aIndentInc, JSONTextMode aMode)
{
aSB.Append("null");
}
public override void SerializeBinary(BinaryWriter aWriter)
{
aWriter.Write((byte)5);
}
}
internal class JSONLazyCreator : JSONNode
{
private readonly string m_Key;
private JSONNode m_Node;
public override JSONNodeType Tag => JSONNodeType.None;
public override JSONNode this[int aIndex]
{
get
{
return new JSONLazyCreator(this);
}
set
{
Set(new JSONArray()).Add(value);
}
}
public override JSONNode this[string aKey]
{
get
{
return new JSONLazyCreator(this, aKey);
}
set
{
Set(new JSONObject()).Add(aKey, value);
}
}
public override int AsInt
{
get
{
Set(new JSONNumber(0.0));
return 0;
}
set
{
Set(new JSONNumber(value));
}
}
public override float AsFloat
{
get
{
Set(new JSONNumber(0.0));
return 0f;
}
set
{
Set(new JSONNumber(value));
}
}
public override double AsDouble
{
get
{
Set(new JSONNumber(0.0));
return 0.0;
}
set
{
Set(new JSONNumber(value));
}
}
public override long AsLong
{
get
{
if (JSONNode.longAsString)
{
Set(new JSONString("0"));
}
else
{
Set(new JSONNumber(0.0));
}
return 0L;
}
set
{
if (JSONNode.longAsString)
{
Set(new JSONString(value.ToString()));
}
else
{
Set(new JSONNumber(value));
}
}
}
public override ulong AsULong
{
get
{
if (JSONNode.longAsString)
{
Set(new JSONString("0"));
}
else
{
Set(new JSONNumber(0.0));
}
return 0uL;
}
set
{
if (JSONNode.longAsString)
{
Set(new JSONString(value.ToString()));
}
else
{
Set(new JSONNumber(value));
}
}
}
public override bool AsBool
{
get
{
Set(new JSONBool(aData: false));
return false;
}
set
{
Set(new JSONBool(value));
}
}
public override JSONArray AsArray => Set(new JSONArray());
public override JSONObject AsObject => Set(new JSONObject());
public JSONLazyCreator(JSONNode aNode)
{
m_Node = aNode;
m_Key = null;
}
public JSONLazyCreator(JSONNode aNode, string aKey)
{
m_Node = aNode;
m_Key = aKey;
}
public override Enumerator GetEnumerator()
{
return default(Enumerator);
}
private T Set<T>(T aVal) where T : JSONNode
{
if (m_Key == null)
{
m_Node.Add(aVal);
}
else
{
m_Node.Add(m_Key, aVal);
}
m_Node = null;
return aVal;
}
public override void Add(JSONNode aItem)
{
Set(new JSONArray()).Add(aItem);
}
public override void Add(string aKey, JSONNode aItem)
{
Set(new JSONObject()).Add(aKey, aItem);
}
public static bool operator ==(JSONLazyCreator a, object b)
{
if (b == null)
{
return true;
}
return (object)a == b;
}
public static bool operator !=(JSONLazyCreator a, object b)
{
return !(a == b);
}
public override bool Equals(object obj)
{
if (obj == null)
{
return true;
}
return (object)this == obj;
}
public override int GetHashCode()
{
return 0;
}
internal override void WriteToStringBuilder(StringBuilder aSB, int aIndent, int aIndentInc, JSONTextMode aMode)
{
aSB.Append("null");
}
public override void SerializeBinary(BinaryWriter aWriter)
{
}
}
public static class JSON
{
public static JSONNode Parse(string aJSON)
{
return JSONNode.Parse(aJSON);
}
public static string ToJson(object data, bool isIndented = true)
{
return new SimpleJSONBuilder().Serialize(data, isIndented);
}
public static T FromJson<T>(string data) where T : new()
{
return new SimpleJSONBuilder().Deserialize<T>(data);
}
}
public class SimpleJSONBuilder
{
public T Deserialize<T>(string serializationStream) where T : new()
{
JSONNode value = JSON.Parse(serializationStream);
return (T)SimpleJSONStaticParser.FromJsonNode(value, typeof(T), default(SimpleJSONParserSettings));
}
public string Serialize(object graph, bool isIndented)
{
SimpleJSONParserSettings simpleJSONParserSettings = default(SimpleJSONParserSettings);
simpleJSONParserSettings.IsIndented = isIndented;
SimpleJSONParserSettings settings = simpleJSONParserSettings;
JSONNode jSONNode = SimpleJSONStaticParser.ToJsonNode(graph, settings);
StringBuilder stringBuilder = new StringBuilder();
jSONNode.WriteToStringBuilder(stringBuilder, 0, settings.IsIndented ? 2 : 0, settings.IsIndented ? JSONTextMode.Indent : JSONTextMode.Compact);
return stringBuilder.ToString();
}
}
public struct SimpleJSONParserSettings
{
public bool IsIndented;
public static SimpleJSONParserSettings Default()
{
SimpleJSONParserSettings result = default(SimpleJSONParserSettings);
result.IsIndented = true;
return result;
}
}
public static class SimpleJSONStaticParser
{
public static object FromJsonNodeImplicitSlow(JSONNode node, Type type)
{
Type typeFromHandle = typeof(JSONNode);
MethodInfo methodInfo = typeFromHandle.GetMethods(BindingFlags.Static | BindingFlags.Public).FirstOrDefault((MethodInfo info) => info.Name == "op_Implicit" && info.ReturnType == type);
if (methodInfo != null)
{
object[] parameters = new JSONNode[1] { node };
return methodInfo.Invoke(null, parameters);
}
return node;
}
public static object FromJsonNode(JSONNode value, Type type, SimpleJSONParserSettings settings)
{
//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0223: Unknown result type (might be due to invalid IL or missing references)
//IL_024b: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
//IL_02be: Unknown result type (might be due to invalid IL or missing references)
//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
//IL_030e: Unknown result type (might be due to invalid IL or missing references)
if (value == null)
{
return null;
}
if (type == typeof(string))
{
return (string)value;
}
if (type == typeof(char))
{
return (char)value;
}
if (type == typeof(bool))
{
return (bool)value;
}
if (typeof(IList).IsAssignableFrom(type))
{
Type typeFromHandle = typeof(List<>);
Type[] genericArguments = type.GetGenericArguments();
Type type2 = typeFromHandle.MakeGenericType(genericArguments);
IList list = (IList)Activator.CreateInstance(type2);
foreach (JSONNode child in value.AsArray.Children)
{
list.Add(FromJsonNode(child, genericArguments[0], settings));
}
return list;
}
if (typeof(IDictionary).IsAssignableFrom(type))
{
Type typeFromHandle2 = typeof(Dictionary<, >);
Type[] genericArguments2 = type.GetGenericArguments();
Type type3 = typeFromHandle2.MakeGenericType(genericArguments2);
IDictionary dictionary = (IDictionary)Activator.CreateInstance(type3);
JSONNode.Enumerator enumerator2 = value.GetEnumerator();
while (enumerator2.MoveNext())
{
KeyValuePair<string, JSONNode> current2 = enumerator2.Current;
dictionary.Add(FromJsonNode(current2.Key, genericArguments2[0], settings), FromJsonNode(current2.Value, genericArguments2[1], settings));
}
return dictionary;
}
if (type == typeof(Vector2))
{
return (Vector2)value;
}
if (type == typeof(Vector3))
{
return (Vector3)value;
}
if (type == typeof(Vector4))
{
return (Vector4)value;
}
if (type == typeof(Quaternion))
{
return (Quaternion)value;
}
if (type == typeof(Rect))
{
return (Rect)value;
}
if (type == typeof(RectOffset))
{
return (RectOffset)value;
}
if (type == typeof(Matrix4x4))
{
return (Matrix4x4)value;
}
if (type == typeof(Color))
{
return (Color)value;
}
if (type == typeof(Color32))
{
return (Color32)value;
}
if (type == typeof(byte))
{
return (byte)value;
}
if (type == typeof(sbyte))
{
return (sbyte)value;
}
if (type == typeof(int))
{
return (int)value;
}
if (type == typeof(uint))
{
return (uint)value;
}
if (type == typeof(short))
{
return (short)value;
}
if (type == typeof(ushort))
{
return (ushort)value;
}
if (type == typeof(char))
{
return (char)value;
}
if (type == typeof(float))
{
return (float)value;
}
if (type == typeof(double))
{
return (double)value;
}
if (type == typeof(decimal))
{
return (decimal)value;
}
if (type == typeof(long))
{
return (long)value;
}
if (type == typeof(ulong))
{
return (ulong)value;
}
object obj = Activator.CreateInstance(type);
FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public);
FieldInfo[] array = fields;
foreach (FieldInfo fieldInfo in array)
{
fieldInfo.SetValue(obj, FromJsonNode(value[fieldInfo.Name], fieldInfo.FieldType, settings));
}
return obj;
}
public static JSONNode ToJsonNode(object value, SimpleJSONParserSettings settings)
{
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0206: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_0226: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_0246: Unknown result type (might be due to invalid IL or missing references)
if (value != null)
{
if (!(value is JSONNode result))
{
if (!(value is string aData))
{
if (!(value is char c))
{
if (!(value is bool aData2))
{
if (!(value is IList list))
{
if (!(value is IDictionary dict))
{
if (!(value is Vector2 val))
{
if (!(value is Vector3 val2))
{
if (!(value is Vector4 val3))
{
if (!(value is Quaternion val4))
{
if (!(value is Rect val5))
{
RectOffset val6 = (RectOffset)((value is RectOffset) ? value : null);
if (val6 == null)
{
if (!(value is Matrix4x4 val7))
{
if (!(value is Color val8))
{
if (!(value is Color32 val9))
{
if (value is float num)
{
return new JSONNumber(num.ToString("R", CultureInfo.InvariantCulture));
}
if (JSONNumber.IsNumeric(value))
{
return new JSONNumber(Convert.ToDouble(value));
}
JSONObject jSONObject = new JSONObject();
FieldInfo[] fields = value.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public);
FieldInfo[] array = fields;
foreach (FieldInfo fieldInfo in array)
{
object value2 = fieldInfo.GetValue(value);
JSONNode aItem = ToJsonNode(value2, settings);
jSONObject.Add(fieldInfo.Name, aItem);
}
return jSONObject;
}
return val9;
}
return val8;
}
return val7;
}
return val6;
}
return val5;
}
return val4;
}
return val3;
}
return val2;
}
return val;
}
return ToJsonNode(dict, settings);
}
return ToJsonNode(list, settings);
}
return new JSONBool(aData2);
}
return new JSONString(new string(c, 1));
}
return new JSONString(aData);
}
return result;
}
return JSONNull.CreateOrGet();
}
private static JSONArray ToJsonNode(IList list, SimpleJSONParserSettings settings)
{
JSONArray jSONArray = new JSONArray();
for (int i = 0; i < list.Count; i++)
{
jSONArray.Add(ToJsonNode(list[i], settings));
}
return jSONArray;
}
private static JSONObject ToJsonNode(IDictionary dict, SimpleJSONParserSettings settings)
{
JSONObject jSONObject = new JSONObject();
foreach (object key in dict.Keys)
{
jSONObject.Add(key.ToString(), ToJsonNode(dict[key], settings));
}
return jSONObject;
}
}
public enum JSONContainerType
{
Array,
Object
}
}
namespace DSPJapanesePlugin
{
internal class GASAccess
{
[CompilerGenerated]
private sealed class <CheckAndDownload>d__0 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public string Url;
public string dstPath;
private string <LastUpdate>5__1;
private UnityWebRequest <request>5__2;
private AsyncOperation <checkAsync>5__3;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <CheckAndDownload>d__0(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<LastUpdate>5__1 = null;
<request>5__2 = null;
<checkAsync>5__3 = null;
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
if (!File.Exists(dstPath))
{
<LastUpdate>5__1 = "0";
}
else
{
<LastUpdate>5__1 = File.GetLastWriteTime(dstPath).ToString("yyyyMMddHHmmss");
}
LogManager.Logger.LogInfo((object)("URL : " + Url + "?date=" + <LastUpdate>5__1));
<request>5__2 = UnityWebRequest.Get(Url + "?date=" + <LastUpdate>5__1);
<request>5__2.timeout = 10;
<checkAsync>5__3 = (AsyncOperation)(object)<request>5__2.SendWebRequest();
while (!<checkAsync>5__3.isDone)
{
}
if (<request>5__2.isNetworkError || <request>5__2.isHttpError)
{
LogManager.Logger.LogInfo((object)("辞書チェックエラー : " + <request>5__2.error));
}
else if (<request>5__2.downloadHandler.text == "match")
{
LogManager.Logger.LogInfo((object)"辞書は最新です");
Main.JPDictionary = JSON.FromJson<Dictionary<string, string>>(File.ReadAllText(dstPath));
}
else if (<request>5__2.downloadHandler.data.Length < 2000)
{
LogManager.Logger.LogInfo((object)("辞書のダウンロードに失敗しました\u3000:\u3000" + Regex.Match(<request>5__2.downloadHandler.text, "TypeError.*)")));
}
else
{
LogManager.Logger.LogInfo((object)"辞書をダウンロードしました");
Main.JPDictionary = JSON.FromJson<Dictionary<string, string>>(<request>5__2.downloadHandler.text);
File.WriteAllText(dstPath, <request>5__2.downloadHandler.text);
}
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <DownloadAndSave>d__2 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public string Url;
public string dstPath;
private UnityWebRequest <request>5__1;
private AsyncOperation <checkAsync>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <DownloadAndSave>d__2(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<request>5__1 = null;
<checkAsync>5__2 = null;
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<request>5__1 = UnityWebRequest.Get(Url);
<checkAsync>5__2 = (AsyncOperation)(object)<request>5__1.SendWebRequest();
while (!<checkAsync>5__2.isDone)
{
}
if (<request>5__1.isNetworkError || <request>5__1.isHttpError)
{
LogManager.Logger.LogInfo((object)("Dictionary download error : " + <request>5__1.error));
}
else
{
LogManager.Logger.LogInfo((object)"Dictionary downloaded");
File.WriteAllText(dstPath, <request>5__1.downloadHandler.text);
LogManager.Logger.LogInfo((object)"Dictionary saved ");
}
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <MakeFromSheet>d__1 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public string Url;
public string dstPath;
private UnityWebRequest <request>5__1;
private AsyncOperation <checkAsync>5__2;
private string <strings>5__3;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <MakeFromSheet>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<request>5__1 = null;
<checkAsync>5__2 = null;
<strings>5__3 = null;
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
LogManager.Logger.LogInfo((object)("URL : " + Url));
<request>5__1 = UnityWebRequest.Get(Url ?? "");
<request>5__1.timeout = 10;
<checkAsync>5__2 = (AsyncOperation)(object)<request>5__1.SendWebRequest();
while (!<checkAsync>5__2.isDone)
{
}
if (<request>5__1.isNetworkError || <request>5__1.isHttpError)
{
LogManager.Logger.LogInfo((object)("辞書チェックエラー : " + <request>5__1.error));
}
else if (<request>5__1.downloadHandler.data.Length < 2000)
{
LogManager.Logger.LogInfo((object)("辞書のダウンロードに失敗しました\u3000:\u3000" + Regex.Match(<request>5__1.downloadHandler.text, "TypeError.*)")));
}
else
{
LogManager.Logger.LogInfo((object)"辞書をダウンロードしました");
<strings>5__3 = <request>5__1.downloadHandler.text.Replace("[LF]", "\\n").Replace("[CRLF]", "\\r\\n");
Main.JPDictionary = JSON.FromJson<Dictionary<string, string>>(<strings>5__3);
File.WriteAllText(dstPath, <strings>5__3);
<strings>5__3 = null;
}
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <TranslateString>d__3 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public string ENUSString;
private UnityWebRequest <request>5__1;
private AsyncOperation <checkAsync>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <TranslateString>d__3(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<request>5__1 = null;
<checkAsync>5__2 = null;
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
if (ENUSString == "")
{
<>2__current = "";
<>1__state = 1;
return true;
}
goto IL_005d;
case 1:
<>1__state = -1;
goto IL_005d;
case 2:
{
<>1__state = -1;
return false;
}
IL_005d:
<request>5__1 = UnityWebRequest.Get(Main.TranslateGAS.Value + "?text=" + ENUSString);
<request>5__1.timeout = 10;
<checkAsync>5__2 = (AsyncOperation)(object)<request>5__1.SendWebRequest();
while (!<checkAsync>5__2.isDone)
{
}
if (<request>5__1.isNetworkError || <request>5__1.isHttpError)
{
LogManager.Logger.LogInfo((object)("GASアクセスエラー : " + <request>5__1.error));
}
else if (<request>5__1.downloadHandler.text == "traslateFailed")
{
LogManager.Logger.LogInfo((object)"GAS翻訳に失敗しました。");
}
else
{
LogManager.Logger.LogInfo((object)("GAS翻訳に成功しました。: " + <request>5__1.downloadHandler.text));
}
<>2__current = <request>5__1.downloadHandler.text;
<>1__state = 2;
return true;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext