예제 #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();
     }
 }
예제 #2
0
        void OnGUI()
        {
            XTweenData data = XTweenExporter.Instance.Data;

            GUILayout.BeginVertical();

            GUILayout.BeginVertical("Box");
            {
                GUILayout.Space(3f);
                GUILayout.Label("Export", "BoldLabel");
                GUILayout.Space(3f);
            }
            GUILayout.EndVertical();

            GUILayout.Space(10f);

            bool changed = false;

            GUILayout.BeginHorizontal();
            GUILayout.Label("Current Version", GUILayout.Width(110f));
            this._xtweenVersion = EditorGUILayout.TextField(this._xtweenVersion);
            if (this._xtweenVersion != data.version)
            {
                changed = true;
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Next Version", GUILayout.Width(110f));
            GUILayout.Label(XTweenExporter.Instance.ExportVersion);
            GUI.backgroundColor = (changed) ? Color.green : Color.gray;
            if (GUILayout.Button("Save", GUILayout.Width(100f)))
            {
                data.version = this._xtweenVersion;
                XTweenExporter.Instance.Save();
                changed = false;
            }
            GUI.backgroundColor = Color.white;
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);

            if (GUILayout.Button("Export Core", GUILayout.Height(25f)))
            {
                string exportVersion = XTweenExporter.Instance.ExportVersion;
                XTweenExporter.Instance.Export(false);
                this._xtweenVersion = exportVersion;
            }


            GUI.backgroundColor = Color.green;
            if (GUILayout.Button("Export All", GUILayout.Height(30f)))
            {
                XTweenExporter.Instance.Export(true);
            }
            GUI.backgroundColor = Color.white;

            GUILayout.Space(20f);

            /* if(GUILayout.Button("Test", GUILayout.Height(30f)))
             * {
             *  // XTweenExporter.UpdateReleasePath();
             * } */

            GUILayout.Space(10f);

            GUILayout.EndVertical();
        }