private void UpdateReleasePath() { string currentVersion = XTweenVersionController.To.Data.version; string first = "Version(Alpha) "; string end = ".unitypackage)"; string replace = "Version(Alpha) {VER} - [XTween_{VER}.unitypackage](https://github.com/Toki-Labs/XTween/raw/master/Bin/XTween_{VER}.unitypackage)"; replace = replace.Replace("{VER}", currentVersion); string filePath = SystemUtil.AbsPath + "/README.md"; string content = FileReference.Read(filePath); content = ReplaceTargetStringInContent(first, end, replace, content); FileReference.Write(filePath, content); first = "<!--Version Start"; end = "Version End-->"; replace = "<!--Version Start-->\n" + "<p>Version(Alpha) " + currentVersion + " - <a href=\"https://github.com/Toki-Labs/XTween/raw/master/Bin/XTween_" + currentVersion + ".unitypackage\">XTween_" + currentVersion + ".unitypackage</a></p>\n" + "<!--Version End-->"; filePath = SystemUtil.AbsPath + "/Export/index.html"; content = FileReference.Read(filePath); content = ReplaceTargetStringInContent(first, end, replace, content); FileReference.Write(filePath, content); }
public void Load() { if (File.Exists(this.JsonPath)) { string jsonStr = FileReference.Read(this.JsonPath); this._data = JsonUtility.FromJson <VersionData>(jsonStr); } else { this._data = new VersionData(); this.Save(); } }
public static void UpdateEasingName() { List <EasingData> easingList = XTweenEditorData.Instance.easingDataList; List <string> easingNameList = new List <string>(); easingList.ForEach(x => easingNameList.Add(x.name)); string[] names = easingNameList.ToArray(); string filePath = SystemUtil.AbsPath + "/Assets/Toki/XAssets/XTween/Scripts/EaseCustom.cs"; bool refresh = false; if (File.Exists(filePath)) { List <string> scriptEnumList = new List <string>(XTweenDataUtil.GetEnumNameList <EaseCustom>()); if (scriptEnumList.Count == easingNameList.Count) { int length = easingNameList.Count; for (int i = 0; i < length; ++i) { if (!scriptEnumList.Contains(easingNameList[i])) { refresh = true; break; } } } else { refresh = true; } } else { refresh = true; } if (refresh) { string replaceStr = string.Join(",\n\t", names); string path = SystemUtil.AbsPath + "/Assets/Toki/XAssets/XTween/Scripts/Editor/EaseCustomTemplete"; string content = FileReference.Read(path); content = content.Replace("/* Name List */", replaceStr); FileReference.Write(filePath, content); XTweenEditorData.Instance.Save(); AssetDatabase.Refresh(); } }