Example #1
0
    public JSONInStream Content(string tag, out Color value)
    {
        //IL_0029: 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)
        IJSONFieldValue field = node.GetField(tag);

        if (field.GetType() == typeof(JSONNullFieldValue))
        {
            value = Color.get_white();
            return(this);
        }
        float[] fs = new float[4];
        List(tag, delegate(int i, JSONInStream stream)
        {
            stream.Content(out float value2);
            fs[i] = value2;
        });
        value._002Ector(fs[0], fs[1], fs[2], fs[3]);
        return(this);
    }
Example #2
0
    public JSONInStream Content(int idx, out Vector2 value)
    {
        //IL_0029: 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)
        IJSONFieldValue field = node.GetField(idx);

        if (field.GetType() == typeof(JSONNullFieldValue))
        {
            value = Vector2.get_zero();
            return(this);
        }
        float[] fs = new float[2];
        List(idx, delegate(int i, JSONInStream stream)
        {
            stream.Content(out float value2);
            fs[i] = value2;
        });
        value._002Ector(fs[0], fs[1]);
        return(this);
    }
Example #3
0
    public JSONInStream Content(int idx, out Rect value)
    {
        // null ?
        IJSONFieldValue fieldValue = node.GetField(idx);

        if (fieldValue.GetType() == typeof(JSONNullFieldValue))
        {
            value = new Rect();
            return(this);
        }

        // unpack values
        float[] fs = new float[4];
        List(idx, delegate(int i, JSONInStream stream){
            float f;
            stream.Content(out f);
            fs[i] = f;
        });
        value = new Rect(fs[0], fs[1], fs[2], fs[3]);
        return(this);
    }
Example #4
0
    // COLOR

    public JSONInStream Content(string tag, out Color value)
    {
        // null ?
        IJSONFieldValue fieldValue = node.GetField(tag);

        if (fieldValue.GetType() == typeof(JSONNullFieldValue))
        {
            value = Color.white;
            return(this);
        }

        // unpack values
        float[] fs = new float[4];
        List(tag, delegate(int i, JSONInStream stream){
            float f;
            stream.Content(out f);
            fs[i] = f;
        });
        value = new Color(fs[0], fs[1], fs[2], fs[3]);
        return(this);
    }
Example #5
0
    // VECTOR2

    public JSONInStream Content(string tag, out Vector2 value)
    {
        // null ?
        IJSONFieldValue fieldValue = node.GetField(tag);

        if (fieldValue.GetType() == typeof(JSONNullFieldValue))
        {
            value = Vector2.zero;
            return(this);
        }

        // unpack values
        float[] fs = new float[2];
        List(tag, delegate(int i, JSONInStream stream){
            float f;
            stream.Content(out f);
            fs[i] = f;
        });
        value = new Vector2(fs[0], fs[1]);
        return(this);
    }
Example #6
0
    public JSONInStream ContentOptional(string tag, ref Rect value)
    {
        //IL_0031: Unknown result type (might be due to invalid IL or missing references)
        IJSONFieldValue field = node.GetField(tag);

        if (field == null)
        {
            return(this);
        }
        if (field.GetType() == typeof(JSONNullFieldValue))
        {
            value = default(Rect);
            return(this);
        }
        float[] fs = new float[4];
        List(tag, delegate(int i, JSONInStream stream)
        {
            stream.Content(out float value2);
            fs[i] = value2;
        });
        value._002Ector(fs[0], fs[1], fs[2], fs[3]);
        return(this);
    }
Example #7
0
 public void AddField(IJSONFieldValue val)
 {
     fields_.Add(new JSONField(null, val));
 }
Example #8
0
 public void AddField(int idx, IJSONFieldValue val)
 {
     fields_.Add(new JSONField(idx.ToString(), val));
 }
Example #9
0
 public void AddField(string fieldName, IJSONFieldValue val)
 {
     fields_.Add(new JSONField(fieldName, val));
 }
Example #10
0
 public JSONNode(IJSONFieldValue val)
 {
     fields_.Add(new JSONField("0", val));
 }
Example #11
0
 public JSONField(string n, IJSONFieldValue val)
 {
     name  = n;
     value = val;
 }
 public JSONField(string n, IJSONFieldValue val)
 {
     name  = n;
     value = val;
 }
Example #13
0
 public void AddField(IJSONFieldValue val)
 {
     fields_.Add(new JSONField(null, val));
 }
Example #14
0
 public void AddField(int idx, IJSONFieldValue val)
 {
     fields_.Add(new JSONField(idx.ToString(), val));
 }
Example #15
0
 public void AddField(string fieldName, IJSONFieldValue val)
 {
     fields_.Add(new JSONField(fieldName, val));
 }
Example #16
0
 public JSONNode(IJSONFieldValue val)
 {
     fields_.Add(new JSONField("0", val));
 }