示例#1
0
        public static void Save()
        {
            JObject config = new JObject(
                new JProperty("exportPath", exportPath),
                new JProperty("importPath", importPath),
                new JProperty("exporterSettings", ExporterSettings.Serialize())
                );

            Utils.SaveJson(config, configPath);
        }
示例#2
0
        public static void Load()
        {
            AppDataPath = Application.dataPath;
            configPath  = Path.Combine(Application.dataPath, "./seinjs.config.json");
            JObject config = new JObject();

            if (File.Exists(configPath))
            {
                config = JObject.Parse(File.ReadAllText(configPath));
            }

            exportPath = (string)config["exportPath"];
            if (string.IsNullOrEmpty(exportPath))
            {
                exportPath = DefaultExportFolder;
            }

            importPath = (string)config["importPath"];
            if (string.IsNullOrEmpty(importPath))
            {
                importPath = DefaultImportFolder;
            }

            if (IsInWinOS)
            {
                importPath = importPath.Replace("/", "\\");
                exportPath = exportPath.Replace("/", "\\");
            }
            else
            {
                importPath = importPath.Replace("\\", "/");
                exportPath = exportPath.Replace("\\", "/");
            }

            ExporterSettings.Deserialize((JObject)config["exporterSettings"]);

            if (File.Exists(configPath))
            {
                Save();
            }

            header = new Texture2D(1, 1);
            header.LoadImage(File.ReadAllBytes(Path.Combine(AppDataPath, "./SeinJSUnityToolkit/logo.jpg")));
            header.Apply();
        }