public void SetValue(int index, object obj)
        {
            if (values == null)
            {
                this.values = new List <Value>();
            }

            if (index < 0 || index > values.Count)
            {
                return;
            }

            if (index == values.Count)
            {
                this.values.Add(new Value());
            }

            Value value = this.values[index];

            if (value == null)
            {
                value         = new Value();
                values[index] = value;
            }

            switch (type)
            {
            case ValueType.Sprite:
            case ValueType.Texture2D:
            case ValueType.Texture3D:
            case ValueType.AudioClip:
            case ValueType.VideoClip:
            case ValueType.Material:
            case ValueType.Font:
            case ValueType.GameObject:
                value.objectValue = (Object)obj;
                break;

            case ValueType.String:
                value.dataValue = DataConverter.GetString((string)obj);
                break;

            case ValueType.Boolean:
                value.dataValue = DataConverter.GetString((bool)obj);
                break;

            case ValueType.Float:
                value.dataValue = DataConverter.GetString((float)obj);
                break;

            case ValueType.Int:
                value.dataValue = DataConverter.GetString((int)obj);
                break;

            case ValueType.Color:
                value.dataValue = DataConverter.GetString((Color)obj);
                break;

            case ValueType.Vector2:
                value.dataValue = DataConverter.GetString((Vector2)obj);
                break;

            case ValueType.Vector3:
                value.dataValue = DataConverter.GetString((Vector3)obj);
                break;

            case ValueType.Vector4:
                value.dataValue = DataConverter.GetString((Vector4)obj);
                break;

            default:
                break;
            }
        }
        public object GetValue(int index)
        {
            if (values == null || values.Count <= 0)
            {
                return(null);
            }

            if (index < 0 || index >= values.Count)
            {
                return(null);
            }

            Value value = this.values[index];

            if (value == null)
            {
                return(null);
            }

            string data = value.dataValue;

            switch (type)
            {
            case ValueType.Sprite:
            case ValueType.Texture2D:
            case ValueType.Texture3D:
            case ValueType.AudioClip:
            case ValueType.VideoClip:
            case ValueType.Material:
            case ValueType.Font:
            case ValueType.GameObject:
                return(value.objectValue);

            case ValueType.String:
                return(DataConverter.ToString(data));

            case ValueType.Boolean:
                return(DataConverter.ToBoolean(data));

            case ValueType.Float:
                return(DataConverter.ToSingle(data));

            case ValueType.Int:
                return(DataConverter.ToInt32(data));

            case ValueType.Color:
                return(DataConverter.ToColor(data));

            case ValueType.Vector2:
                return(DataConverter.ToVector2(data));

            case ValueType.Vector3:
                return(DataConverter.ToVector3(data));

            case ValueType.Vector4:
                return(DataConverter.ToVector4(data));

            default:
                return(null);
            }
        }