示例#1
0
        private static void RegisterEngineAssembly(Assembly assembly)
        {
            if (assembly == null)
            {
                throw new ArgumentNullException(nameof(assembly));
            }

            lock (RegistryLock)
            {
                if (RegisteredEngineAssemblies.Contains(assembly))
                {
                    return;
                }

                RegisteredEngineAssemblies.Add(assembly);

                // Process Asset types.
                foreach (var type in assembly.GetTypes())
                {
                    if (ReferenceSerializer.IsReferenceType(type))
                    {
                        RegisteredContentTypes.Add(type, null);
                    }
                }
            }
        }
示例#2
0
 private bool CanVisit(Type type)
 {
     // Also handles Entity, EntityComponent and Script
     return(ReferenceSerializer.IsReferenceType(type) ||
            type == typeof(Entity) || typeof(Entity).IsAssignableFrom(type) || typeof(EntityComponent).IsAssignableFrom(type));
 }
 public override bool CanVisit(Type type)
 {
     return(ReferenceSerializer.IsReferenceType(type));
 }