private static void SaveTextStyleChange() { var appID = ProjectInfoDati.GetActualInstance().DevelopProjectName; currentAppTextStyle = AppTextStyleInfoDic[appID]; string fullPath = GetAppTextStyleSettingTxtPath( appID); var jsContent = UnityEngine.JsonUtility.ToJson(currentAppTextStyle); ////jsContent = EditorAPIInvoker.PrettifyJsonString(jsContent); IOUtility.WriteAllText(fullPath, jsContent); }
private void ApplyLegoTextStyle(int styleIndex) { YuLegoTextStyleInfo textStyle = YuAppTextStyleInfo.GetTextStyleInfoFromCurrentAppTextStyle(styleIndex); if (textStyle != null) { font = textStyle.font; fontStyle = textStyle.fontStyle; fontSize = textStyle.textSize; color = textStyle.color; alignment = textStyle.TextAnchor; if (textStyle.lineStyle == LineStyle.singleLine) { RectTransform.sizeDelta = new Vector2(preferredWidth, originalSizeDelta.y); RectTransform.sizeDelta = new Vector2(preferredWidth, preferredHeight); } } }