public static glTF_VCAST_vci_Text glTF_VCAST_vci_text_Deserializevci_text(JsonNode parsed) { var value = new glTF_VCAST_vci_Text(); foreach (var kv in parsed.ObjectItems()) { var key = kv.Key.GetString(); if (key == "fontName") { value.fontName = kv.Value.GetString(); continue; } if (key == "text") { value.text = kv.Value.GetString(); continue; } if (key == "richText") { value.richText = kv.Value.GetBoolean(); continue; } if (key == "fontSize") { value.fontSize = kv.Value.GetSingle(); continue; } if (key == "autoSize") { value.autoSize = kv.Value.GetBoolean(); continue; } if (key == "fontStyle") { value.fontStyle = kv.Value.GetInt32(); continue; } if (key == "color") { value.color = glTF_VCAST_vci_text_Deserializevci_text_color(kv.Value); continue; } if (key == "enableVertexGradient") { value.enableVertexGradient = kv.Value.GetBoolean(); continue; } if (key == "topLeftColor") { value.topLeftColor = glTF_VCAST_vci_text_Deserializevci_text_topLeftColor(kv.Value); continue; } if (key == "topRightColor") { value.topRightColor = glTF_VCAST_vci_text_Deserializevci_text_topRightColor(kv.Value); continue; } if (key == "bottomLeftColor") { value.bottomLeftColor = glTF_VCAST_vci_text_Deserializevci_text_bottomLeftColor(kv.Value); continue; } if (key == "bottomRightColor") { value.bottomRightColor = glTF_VCAST_vci_text_Deserializevci_text_bottomRightColor(kv.Value); continue; } if (key == "characterSpacing") { value.characterSpacing = kv.Value.GetSingle(); continue; } if (key == "wordSpacing") { value.wordSpacing = kv.Value.GetSingle(); continue; } if (key == "lineSpacing") { value.lineSpacing = kv.Value.GetSingle(); continue; } if (key == "paragraphSpacing") { value.paragraphSpacing = kv.Value.GetSingle(); continue; } if (key == "alignment") { value.alignment = kv.Value.GetInt32(); continue; } if (key == "enableWordWrapping") { value.enableWordWrapping = kv.Value.GetBoolean(); continue; } if (key == "overflowMode") { value.overflowMode = kv.Value.GetInt32(); continue; } if (key == "enableKerning") { value.enableKerning = kv.Value.GetBoolean(); continue; } if (key == "extraPadding") { value.extraPadding = kv.Value.GetBoolean(); continue; } if (key == "margin") { value.margin = glTF_VCAST_vci_text_Deserializevci_text_margin(kv.Value); continue; } } return(value); }
public static void Serialize_vci_text(JsonFormatter f, glTF_VCAST_vci_Text value) { f.BeginMap(); if (!string.IsNullOrEmpty(value.fontName)) { f.Key("fontName"); f.Value(value.fontName); } if (!string.IsNullOrEmpty(value.text)) { f.Key("text"); f.Value(value.text); } if (true) { f.Key("richText"); f.Value(value.richText); } if (true) { f.Key("fontSize"); f.Value(value.fontSize); } if (true) { f.Key("autoSize"); f.Value(value.autoSize); } if (true) { f.Key("fontStyle"); f.Value(value.fontStyle); } if (value.color != null && value.color.Length >= 4) { f.Key("color"); Serialize_vci_text_color(f, value.color); } if (true) { f.Key("enableVertexGradient"); f.Value(value.enableVertexGradient); } if (value.topLeftColor != null && value.topLeftColor.Length >= 4) { f.Key("topLeftColor"); Serialize_vci_text_topLeftColor(f, value.topLeftColor); } if (value.topRightColor != null && value.topRightColor.Length >= 4) { f.Key("topRightColor"); Serialize_vci_text_topRightColor(f, value.topRightColor); } if (value.bottomLeftColor != null && value.bottomLeftColor.Length >= 4) { f.Key("bottomLeftColor"); Serialize_vci_text_bottomLeftColor(f, value.bottomLeftColor); } if (value.bottomRightColor != null && value.bottomRightColor.Length >= 4) { f.Key("bottomRightColor"); Serialize_vci_text_bottomRightColor(f, value.bottomRightColor); } if (true) { f.Key("characterSpacing"); f.Value(value.characterSpacing); } if (true) { f.Key("wordSpacing"); f.Value(value.wordSpacing); } if (true) { f.Key("lineSpacing"); f.Value(value.lineSpacing); } if (true) { f.Key("paragraphSpacing"); f.Value(value.paragraphSpacing); } if (true) { f.Key("alignment"); f.Value(value.alignment); } if (true) { f.Key("enableWordWrapping"); f.Value(value.enableWordWrapping); } if (true) { f.Key("overflowMode"); f.Value(value.overflowMode); } if (true) { f.Key("enableKerning"); f.Value(value.enableKerning); } if (true) { f.Key("extraPadding"); f.Value(value.extraPadding); } if (value.margin != null && value.margin.Length >= 4) { f.Key("margin"); Serialize_vci_text_margin(f, value.margin); } f.EndMap(); }