示例#1
0
        /// <summary>
        /// <para> Save the catalog data. </para>
        /// <para> See: <see cref="UniDataSettings.Saver"/> </para>
        /// </summary>
        /// <exception cref="ArgumentNullException"></exception>
        public static void Save <T> (this T catalog, DataCatalogIOContext context) where T : DataCatalog
        {
            if (catalog == null)
            {
                throw new ArgumentNullException(nameof(catalog));
            }
            DataCatalogIOAsset saver = UniDataSettings.Instance.Saver;

            if (saver != null)
            {
                Debug.Log($"Save \"{catalog.name}\" catalog.");
                saver.Save(catalog, context);
            }
        }
示例#2
0
        /// <summary>
        /// <para> Execute loaders in sequence to load the catalog data. </para>
        /// <para> See: <see cref="UniDataSettings.Loaders"/> </para>
        /// </summary>
        /// <exception cref="ArgumentNullException"></exception>
        public static void Load <T> (this T catalog, DataCatalogIOContext context) where T : DataCatalog
        {
            if (catalog == null)
            {
                throw new ArgumentNullException(nameof(catalog));
            }

            Debug.Log($"Load \"{catalog.name}\" catalog.");

            foreach (DataCatalogIOAsset loader in UniDataSettings.Instance.Loaders)
            {
                loader.Load(catalog, context);
            }
        }
示例#3
0
 public abstract void Load(DataCatalog catalog, DataCatalogIOContext context);
示例#4
0
 public abstract void Save(DataCatalog catalog, DataCatalogIOContext context);