コード例 #1
0
        private static void Register(Type FactoryClass)
        {
            var factory = (SeinExtensionFactory)Activator.CreateInstance(FactoryClass);

            var name       = factory.GetExtensionName();
            var components = factory.GetBindedComponents();
            var types      = factory.GetExtensionTypes();

            factory.ExtensionName  = name;
            factory.ExtensionTypes = types;

            if (Class2Extensions.ContainsKey(FactoryClass))
            {
                return;
            }

            GLTFProperty.RegisterExtension(factory);
            Name2Extensions.Add(name, factory);
            Class2Extensions.Add(FactoryClass, name);

            foreach (var component in components)
            {
                if (!Component2Extensions.ContainsKey(component))
                {
                    Component2Extensions.Add(component, new List <string>());
                }

                Component2Extensions[component].Add(name);
            }
        }
コード例 #2
0
 public static void Initialize()
 {
     GLTFProperty.RegisterExtension(new CoordinateSystemExtensionFactory());
     GLTFProperty.RegisterExtension(new AnimationExtensionFactory());
 }