Exemple #1
0
 void OnEnable()
 {
     //加载配置文件
     ExportSetting.Reload(PathHelper.ConfigPath, PathHelper.SaveRootDirectory);
     //初始化一些全局的方法
     SerializeObject.Initialize();
 }
Exemple #2
0
        public static void Reload(string configPath, string defaultExportPath)
        {
            if (System.IO.File.Exists(configPath))
            {
                var jsonStr = System.IO.File.ReadAllText(configPath, System.Text.Encoding.UTF8);
                _instance = JsonConvert.DeserializeObject <ExportSetting>(jsonStr);
            }
            else
            {
                _instance = new ExportSetting();
            }

            if (!System.IO.Directory.Exists(_instance.exportDir))
            {
                _instance.exportDir = defaultExportPath;
            }

            if (_instance.shader != null)
            {
                foreach (var customShader in _instance.shader)
                {
                    MyLog.Log("customShader:" + customShader.Key);
                }
            }
        }