Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serve Amsterdam ZuidOost assets through an Addressable instead of an AssetBundle #400

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

mvriel
Copy link
Contributor

@mvriel mvriel commented Feb 4, 2025

Prior to this change, the Amsterdam ZuidOost assets -25mb of material- was always loaded at the start of the application. With this change, the intent is for objects to be loaded when needed, instead of on load. This will improve application startup time, base memory usage and clean up the code base.

I have chosen to put the assets into an embedded package (https://docs.unity3d.com/Manual/upm-embed.html) to show how that could work, and to clearly separate the non-core assets.

This PR also introduces the first steps into a Plugin system where

  1. In the ConfigLoader scene a PluginManager can load plugins that we locally provide
  2. When a Plugin is loaded, a PluginManifest file is retrieved and used to populate the AddLayerPanel / Object Library
    2.a) The PluginManifest is part of the addressable, but because it is labeled as "manifest" it will be put into a separate asset bundle, which is tiny in size
  3. When the user opens the Object Library, it will be presented with the option to add a layer that is available in a plugin
  4. if the user adds that plugin, it will start to import the full contents of the Adressable and add the layer

Improvements can be a loading screen while the layer is being loaded, this will be in a separate PR.

Because loading assets can now be asynchronous - I have changed the prefablibrary to look and feel as if all actions are asynchronous, even local layers. This will provide a uniform interface instead of trying to remember which was async and which is not.

For the reviewer:

The AddressableAssetsData folder and contents is part of Unity's addressables system, there is not much to review there in terms of contents in this PR.


namespace Netherlands3D.Functionalities.ObjectLibrary
{
public static class ObjectFactory
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have extracted the Object instantiation / spawning code from the ObjectLibraryButton to be more reusable and have clearer separation of concerns

mvriel added 19 commits February 4, 2025 13:26
…, see https://github.com/Unity-Technologies/Addressables-Sample and https://github.com/Unity-Technologies/Addressables-Sample/blob/master/.gitignore for reference.

I will remove the assets now, and update the gitignore in the next commit so that the content is really gone
… feature build seems to have an issue with that. So, let's disable it. A local build is now good, let's push it
…s that it will be stripped; lets try that out
…ve enabled 'embedded materials' in the obj. I hope / expect that this may solve my issue
…on - this may be overkill. But let's see that it works in a feature build
…fablibrary until the pluginmanifest has become manifest
…reparation of using addressables that need to be created async
…Promise so that I can add addressable support next
…code does not end up in building the addressable because that cannot happen.
@mvriel mvriel marked this pull request as ready for review February 19, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant