Example #1
0
        public override ObjectModel DisassembleValue(Gradient value, DisassemblyContext context)
        {
            ColorAssembler assembler = new ColorAssembler();

            return(new ObjectModel(
                       new ObjectField("ColorKeys", new ArrayModel(
                                           value.colorKeys.Select(x => new ObjectModel(
                                                                      new ObjectField("Time", new PrimitiveModel(x.time)),
                                                                      new ObjectField("Color", assembler.DisassembleValue(x.color, context)))))),

                       new ObjectField("AlphaKeys", new ArrayModel(
                                           value.alphaKeys.Select(x => new ObjectModel(
                                                                      new ObjectField("Time", new PrimitiveModel(x.time)),
                                                                      new ObjectField("Alpha", new PrimitiveModel(x.alpha)))))),

                       new ObjectField("Mode", new PrimitiveModel((int)value.mode))
                       ));
        }