示例#1
0
        public static ResourceType RegisterType(string name, IEnumerable <string> fileExtensions, Type resourceClass)
        {
            if (GetTypeByName(name) != null)
            {
                Log.Fatal($"ResourceManager: RegisterResourceType: The resource with name {name} is already registered.");
            }

            ResourceType type = new ResourceType();

            type.name          = name;
            type.resourceClass = resourceClass;
            //type.loadResourceFunction = loadFunction;
            types.Add(name, type);
            foreach (var v in fileExtensions)
            {
                type.AddExtension(v);
            }

            return(type);
        }