Пример #1
0
        private static bool Load()
        {
            bool loaded = false;

            try {
                var configPath = Model.Settings.Path.BatchBuildConfigPath;

                if (File.Exists(configPath))
                {
                    BatchBuildConfig db = AssetDatabase.LoadAssetAtPath <BatchBuildConfig>(configPath);
                    if (db.m_version == VERSION)
                    {
                        db.Validate();
                        s_config = db;
                        loaded   = true;
                    }
                }

                // try loading pre-1.4 config
                else
                {
                    var oldConfigPath = OldBatchBuildConfigPath;
                    if (File.Exists(oldConfigPath))
                    {
                        BatchBuildConfig db = AssetDatabase.LoadAssetAtPath <BatchBuildConfig>(oldConfigPath);
                        if (db.m_version == VERSION)
                        {
                            db.Validate();
                            s_config = db;
                            loaded   = true;
                            AssetDatabase.MoveAsset(oldConfigPath, configPath);
                        }
                    }
                }
            } catch (Exception e) {
                LogUtility.Logger.LogWarning(LogUtility.kTag, e);
            }

            return(loaded);
        }