Exemple #1
0
 private void Load()
 {
     if (File.Exists(this.JsonPath))
     {
         string jsonStr = XTweenEditorManager.ReadText(this.JsonPath);
         this._data = JsonUtility.FromJson <XTweenData>(jsonStr);
     }
     else
     {
         this._data = new XTweenData();
         this.Save();
     }
 }
Exemple #2
0
        private void UpdateReleasePath()
        {
            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}", Data.version);
            string filePath = XTweenEditorManager.AbsPath + "/README.md";
            string content  = XTweenEditorManager.ReadText(filePath);

            content = ReplaceTargetStringInContent(first, end, replace, content);
            XTweenEditorManager.WriteText(filePath, content);

            first   = "<!--Version Start";
            end     = "Version End-->";
            replace =
                "<!--Version Start-->\n" +
                "<p>Version(Alpha) " + Data.version + " - <a href=\"https://github.com/Toki-Labs/XTween/raw/master/Bin/XTween_" + Data.version + ".unitypackage\">XTween_" + Data.version + ".unitypackage</a></p>\n" +
                "<!--Version End-->";
            filePath = XTweenEditorManager.AbsPath + "/Export/index.html";
            content  = XTweenEditorManager.ReadText(filePath);
            content  = ReplaceTargetStringInContent(first, end, replace, content);
            XTweenEditorManager.WriteText(filePath, content);
        }