Comments (1)
I have a general idea of how I would want this implemented. There's three parts.
Infrastructure
could be changed to
public static GameBundle FromPaths(IEnumerable<string> paths, AssetFactoryBase assetFactory, IFileLoader? fileLoader = null)
with the following implementations:
public interface IFileLoader
{
IDependencyProvider? DependencyProvider => null;
IResourceProvider? ResourceProvider => null;
UnityVersion DefaultVersion => default;
void OnCreated(GameBundle gameBundle, AssetFactoryBase assetFactory) { }
void OnPathsLoaded(GameBundle gameBundle, AssetFactoryBase assetFactory) { }
void OnDependenciesInitialized(GameBundle gameBundle, AssetFactoryBase assetFactory) { }
}
public record class DefaultFileLoader(IDependencyProvider? DependencyProvider = null, IResourceProvider? ResourceProvider = null, UnityVersion DefaultVersion = default)
{
public virtual void OnCreated(GameBundle gameBundle, AssetFactoryBase assetFactory) { }
public virtual void OnPathsLoaded(GameBundle gameBundle, AssetFactoryBase assetFactory) { }
public virtual void OnDependenciesInitialized(GameBundle gameBundle, AssetFactoryBase assetFactory) { }
}
However, I'm not fond of the IFileLoader
name and am very open to alternative naming suggestions.
Injection
//Create an internal or private nested class that inherits from DefaultFileLoader in the AssetRipper.Import project
private sealed record class MyCustomFileLoader : DefaultFileLoader
{
private sealed class InjectedEngineCollection : VirtualAssetCollection
{
//Flags should be TransferInstructionFlags.SerializeGameRelease | TransferInstructionFlags.IsBuiltinResourcesFile
//AssetCollection.AddAsset needs to be changed private protected -> protected
//https://github.com/AssetRipper/AssetRipper/blob/3fa347a3deef9d8ea1c6f7a46daf4fab2e818d2a/Source/AssetRipper.Assets/Collections/VirtualAssetCollection.cs#L23-L56
//That can all be moved to ProcessedAssetCollection
}
private sealed class InjectedEngineBundle : VirtualBundle<InjectedEngineCollection>
{
public InjectedEngineBundle() => Name = "Generated Engine Collections";
}
public override void OnPathsLoaded(GameBundle gameBundle, AssetFactoryBase assetFactory)
{
//Check if "unity default resources" or "unity_default_resources" exists in the project. The same for "unity_builtin_extra" / "unity builtin extra"
//If not exist, add a new InjectedEngineBundle
//Inject missing engine collections to that bundle. Use the maximum Unity version of the project
//Load the appropriate engine resource data from the source generation assembly
//Foreach entry in the resource data, create a new asset with the correct type id, path id, and ideally name
}
}
Export
The engine asset exporter should be modified to recognize the engine files by name when an asset is assessed. If recognized, it will export the asset without checking any properties.
from assetripper.
Related Issues (20)
- [Bug]: MonoBehaviour Import/Export Errors [Ace Attorney Investigations Collection] HOT 1
- [Bug]: doesnt work HOT 2
- [Bug]: some textures/cubemaps fail to export.
- [Enhancement]: Suggestion on adding a way to extract a video from an asset. HOT 3
- [Bug]: Default version / Target version for version changing not loaded from file HOT 2
- [Bug]: Read 591 but expected 592 while reading bundle metadata HOT 6
- [Possible Bug]: Possible Asset Deduplication Miss HOT 21
- [Bug]: A lot of errors are generated when attempting to load assets for the game "A Mother's Inferno" HOT 2
- [Bug]: Partial numerical errors in exported camera data HOT 2
- Mesh Preview Performance
- [Bug]: System.Exception: atlas is not the same as mappedAtlas HOT 2
- [Other]: Unable to use offline HOT 2
- [Bug]: sprites being white/transparent
- [Enhancement]: Add warning alert when leaving with unsaved settings
- Help HOT 2
- [Enhancement]: ~Many part's~(floor) of map's from basically any of bonelab's custom maps fail to load HOT 2
- [Bug]: Unable to load DLL 'nfd' or one of its dependencies HOT 2
- [Bug]: Infinite waiting after loading game folder [Dofus Unity Beta] HOT 1
- [Bug]: Hello! This is a request for help from a foreign novice, with the words' Dummy class' written on it HOT 3
- [Bug]: Use GraphicsFormat for Texture2DArray HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assetripper.