public ResourceBundle AddBundleFromProjectPath(string projectPath)
 {
     // TODO: Throw out the entire resource system. It's shit. Also there is a race condition here...
       if (_bundlesByProjectPath.ContainsKey(projectPath)) return _bundlesByProjectPath[projectPath];
       var bundle = new ResourceBundle(projectPath);
       Console.WriteLine(@"Need to load all .xassets in the folder here...");
       _bundlesByGuid.TryAdd(bundle.Guid, bundle);
       _bundlesByProjectPath.TryAdd(projectPath, bundle);
       return bundle;
 }
Beispiel #2
0
        internal static Resource GetDerivedResouceFromFileType(ResourceBundle resourceBundle, string fullPath)
        {
            switch (GetResourceTypeFromFile(fullPath))
            {
            case ResourceType.Model:
                return(new ModelResource(resourceBundle));

            case ResourceType.Texture:
                return(new TextureResource(resourceBundle));

            default:
                throw new ResourceImportException("Unhandled file type");
            }
        }
Beispiel #3
0
 internal Resource(ResourceBundle bundle)
 {
     ResourceBundle = bundle;
 }
Beispiel #4
0
 internal ModelResource(ResourceBundle bundle) : base(bundle)
 {
     DataBlock = new ModelDataBlock();
 }
Beispiel #5
0
 internal TextureResource(ResourceBundle bundle) : base(bundle)
 {
     DataBlock = new TextureDataBlock();
 }