public string ToJson() { string str = ""; for (int i = 0; i < keyDatas.Count; i++) { str += keyDatas[i].ToJson(); if (i == keyDatas.Count - 1) { continue; } str += ","; } string str2 = ""; for (int i = 0; i < eventDatas.Count; i++) { str2 += eventDatas[i].ToJson(); if (i == eventDatas.Count - 1) { continue; } str2 += ","; } str = string.Format("{0},{1},{2}", StringHelper.KeyValueTojson("name", StringHelper.AddDoubleQuotation(name)) , StringHelper.KeyValueTojson("keys", StringHelper.AddBracket(str)) , StringHelper.KeyValueTojson("events", StringHelper.AddBracket(str2))); return(StringHelper.AddBrace(StringHelper.AddNewLine(str))); }
public string ToJson() { return(StringHelper.AddBrace(string.Format("{0},{1},{2},{3}" , StringHelper.KeyValueTojson("app", StringHelper.AddDoubleQuotation(app)) , StringHelper.KeyValueTojson("version", StringHelper.AddDoubleQuotation(version)) , StringHelper.KeyValueTojson("image", StringHelper.AddDoubleQuotation(image)) , StringHelper.KeyValueTojson("size", size) , StringHelper.KeyValueTojson("scale", scale)))); }
public string ToJson() { return(StringHelper.AddBrace(string.Format("{0},{1},{2},{3},{4}" , StringHelper.KeyValueTojson("frame", frame) , StringHelper.KeyValueTojson("rotated", rotated.ToString().ToLower()) , StringHelper.KeyValueTojson("trimmed", trimmed.ToString().ToLower()) , StringHelper.KeyValueTojson("spriteSourceSize", spriteSourceSize) , StringHelper.KeyValueTojson("sourceSize", sourceSize)))); }
public override string ToJson() { string str = string.Format("{0},{1}" , StringHelper.KeyValueTojson("width", width) , StringHelper.KeyValueTojson("height", height) ); return(StringHelper.AddBrace(str)); }
public override string ToJson() { string str = string.Format("{0},{1},{2},{3}" , StringHelper.KeyValueTojson("area", StringHelper.AddDoubleQuotation(area)) , StringHelper.KeyValueTojson("mask", StringHelper.AddDoubleQuotation(mask)) , StringHelper.KeyValueTojson("bar", StringHelper.AddDoubleQuotation(bar)) , StringHelper.KeyValueTojson("barBg", StringHelper.AddDoubleQuotation(barBg)) ); return(StringHelper.AddBrace(str)); }
public override string ToJson() { string str = string.Format("{0},{1},{2},{3},{4}" , StringHelper.KeyValueTojson("font", StringHelper.AddDoubleQuotation(font)) , StringHelper.KeyValueTojson("text", StringHelper.AddDoubleQuotation(text)) , StringHelper.KeyValueTojson("size", size) , StringHelper.KeyValueTojson("align", StringHelper.AddDoubleQuotation(align)) , StringHelper.KeyValueTojson("color", StringHelper.AddDoubleQuotation("0x" + color))); str += "," + StringHelper.KeyValueTojson("width", width); str += "," + StringHelper.KeyValueTojson("isNormal", isNormal.ToString().ToLower()); return(StringHelper.AddBrace(str)); }
public override string ToJson() { string str = string.Format("{0},{1},{2},{3},{4},{5}" , StringHelper.KeyValueTojson("spriteName", StringHelper.AddDoubleQuotation(spriteName)) , StringHelper.KeyValueTojson("width", width) , StringHelper.KeyValueTojson("height", height) , StringHelper.KeyValueTojson("color", StringHelper.AddDoubleQuotation("0x" + color)) , StringHelper.KeyValueTojson("alpha", alpha) , StringHelper.KeyValueTojson("isInteractive", isInteractive.ToString().ToLower()) ); return(StringHelper.AddBrace(str)); }
public override string ToJson() { string str = string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8}" , StringHelper.KeyValueTojson("placeholder", StringHelper.AddDoubleQuotation(placeholder)) , StringHelper.KeyValueTojson("width", width) , StringHelper.KeyValueTojson("height", height) , StringHelper.KeyValueTojson("fontSzie", fontSzie) , StringHelper.KeyValueTojson("fontColor", StringHelper.AddDoubleQuotation(fontColor)) , StringHelper.KeyValueTojson("placeholderColor", StringHelper.AddDoubleQuotation(placeholderColor)) , StringHelper.KeyValueTojson("isTextArea", StringHelper.AddDoubleQuotation(isTextArea.ToString().ToLower())) , StringHelper.KeyValueTojson("isPassword", StringHelper.AddDoubleQuotation(isPassword.ToString().ToLower())) , StringHelper.KeyValueTojson("isNumberOnly", StringHelper.AddDoubleQuotation(isNumberOnly.ToString().ToLower())) ); return(StringHelper.AddBrace(str)); }
public string ToJson() { Int2 pos = position; Int2 localPos = localPosition; Float2 piv = pivot; pos.y *= -1; localPos.y *= -1; piv.y = 1 - piv.y; string str = string.Format("{0},{1},{2},{3},{4},{5}", StringHelper.KeyValueTojson("name", StringHelper.AddDoubleQuotation(name)), StringHelper.KeyValueTojson("visible", StringHelper.AddDoubleQuotation(go.activeSelf.ToString().ToLower())), StringHelper.KeyValueTojson("position", pos), StringHelper.KeyValueTojson("localPosition", localPos), StringHelper.KeyValueTojson("pivot", piv), StringHelper.KeyValueTojson("scale", scale)); if (component != null) { str += string.Format(",{0}", StringHelper.KeyValueTojson(component.name, component.ToJson())); } string cStr = ""; if (children.Count > 0) { for (int i = 0; i < children.Count; i++) { cStr += children[i].ToJson(); if (i == children.Count - 1) { continue; } cStr += ",\n"; } } str += "," + StringHelper.KeyValueTojson("children", StringHelper.AddBracket(cStr)); return(StringHelper.AddBrace(str)); }
public static string ToJson(UIAtlas atlas) { List <UISpriteData> spriteList = atlas.spriteList; string frameList = ""; for (int i = 0; i < spriteList.Count; i++) { var data = spriteList[i]; frameList += StringHelper.KeyValueTojson(data.name, new SpriteData(data.x, data.y, data.width, data.height)); if (i == spriteList.Count - 1) { continue; } frameList += ",\n"; } frameList = StringHelper.AddBrace(frameList); var meta = new AtlasMeta(Config.app, Config.version, atlas.name + ".png", atlas.texture.width, atlas.texture.height, 1); return(StringHelper.AddBrace(string.Format("{0},\n{1}", StringHelper.KeyValueTojson("frames", frameList) , StringHelper.KeyValueTojson("meta", meta.ToJson())))); }
public static string ToJson(Sprite[] spriteList) { var texHeight = spriteList[0].texture.height; string frameList = ""; for (int i = 0; i < spriteList.Length; i++) { Rect data = spriteList[i].rect; frameList += StringHelper.KeyValueTojson(spriteList[i].name, new SpriteData((int)data.x, (texHeight - (int)data.y) - (int)data.height, (int)data.width, (int)data.height)); if (i == spriteList.Length - 1) { continue; } frameList += ",\n"; } frameList = StringHelper.AddBrace(frameList); Texture tex = spriteList[0].texture; var meta = new AtlasMeta(Config.app, Config.version, tex.name + ".png", tex.width, tex.height, 1); return(StringHelper.AddBrace(string.Format("{0},\n{1}", StringHelper.KeyValueTojson("frames", frameList) , StringHelper.KeyValueTojson("meta", meta.ToJson())))); }
public override string ToJson() { string str = ""; for (int i = 0; i < toggles.Length; i++) { str += StringHelper.AddBrace(string.Format("{0},{1}" , StringHelper.KeyValueTojson("buttonName", StringHelper.AddDoubleQuotation(toggles[i].button.name)) , StringHelper.KeyValueTojson("onImageName", StringHelper.AddDoubleQuotation(toggles[i].onImage.name)))); if (i == toggles.Length - 1) { continue; } str += ","; } str = string.Format("{0},{1}" , StringHelper.KeyValueTojson("defaultIndex", defaultIndex) , StringHelper.KeyValueTojson("toggles", StringHelper.AddBracket(str))); return(StringHelper.AddBrace(str)); }
public override string ToJson() { string str = string.Format("{0},{1},{2},{3},{4}" , StringHelper.KeyValueTojson("transition", transition) , StringHelper.KeyValueTojson("normal", StringHelper.AddDoubleQuotation(normal)) , StringHelper.KeyValueTojson("over", StringHelper.AddDoubleQuotation(over)) , StringHelper.KeyValueTojson("push", StringHelper.AddDoubleQuotation(push)) , StringHelper.KeyValueTojson("disabled", StringHelper.AddDoubleQuotation(disabled))); if (transition == 1) { str += "," + StringHelper.KeyValueTojson("spriteName", StringHelper.AddDoubleQuotation(spriteName)); } if (isBorder) { str += "," + StringHelper.KeyValueTojson("border", border.ToJson()); str += "," + StringHelper.KeyValueTojson("width", width); str += "," + StringHelper.KeyValueTojson("height", height); } return(StringHelper.AddBrace(str)); }
public string ToJson() { string str = ""; str = string.Format("{0},{1}" , StringHelper.KeyValueTojson("eventName", StringHelper.AddDoubleQuotation(eventName)) , StringHelper.KeyValueTojson("time", time)); if (floatParameter != 0) { str += "," + StringHelper.KeyValueTojson("parameter", floatParameter); } else if (intParameter != 0) { str += "," + StringHelper.KeyValueTojson("parameter", intParameter); } else if (stringParameter != "") { str += "," + StringHelper.KeyValueTojson("parameter", StringHelper.AddDoubleQuotation(stringParameter)); } return(StringHelper.AddBrace(str)); }
public string ToJson() { string str = string.Format("{0},{1},", StringHelper.KeyValueTojson("path", StringHelper.AddDoubleQuotation(path)) , StringHelper.KeyValueTojson("property", StringHelper.AddDoubleQuotation(property))); string keyString = ""; for (int i = 0; i < keys.Count; i++) { keyString += keys[i].ToJson(); if (i == keys.Count - 1) { continue; } keyString += ","; } keyString = StringHelper.AddBracket(keyString); str += StringHelper.KeyValueTojson("keys", keyString); return(StringHelper.AddBrace(str)); }
public string ToJson() { return(StringHelper.AddBrace(string.Format("{0},{1}" , StringHelper.KeyValueTojson("time", time) , StringHelper.KeyValueTojson("value", value)))); }