// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 using System.Collections.Generic; namespace GLTFast.Addons { /// /// Central point to register glTFast import add-ons. /// All registered import add-ons will be injected into all /// and their /// public static class ImportAddonRegistry { static List s_Addons; /// /// Registers an add-on. /// /// Import add-on to register. public static void RegisterImportAddon(ImportAddon addon) { CertifyDefaultAddonsRegistered(); s_Addons.Add(addon); } /// /// Injects all registered import add-ons into a . /// /// Target internal static void InjectAllAddons(GltfImportBase gltfImport) { CertifyDefaultAddonsRegistered(); foreach (var importAddon in s_Addons) { importAddon.CreateImportInstance(gltfImport); } } static void CertifyDefaultAddonsRegistered() { if (s_Addons == null) { s_Addons = new List(); // TODO: Register all default import add-ons // TODO: Investigate if add-ons can be auto-registered via reflection } } } }