Setup - WhateverDevs/SceneManagement GitHub Wiki
Addressables
After installing the package from the package manager you will need to create the files to work with Addressables.
The addressables system will ask you to create the settings files.
You'll see that it has created a folder called AddressableAssetsData on the Assets folder. Every Unity Addressable setting can be found within this folder. We will afterwards create additional folders for the Whatever Devs setup.
If you want to open the Addressables Groups window again you can also do it by clicking on the AddressableAssetSettings scriptable and then on Manage Groups.
Now, we will create a new folder on our data folder for our scriptables, we can call it SceneManagement/Addressables. On this folder we will create an AddressablesManager, an AddressableVersionDependence library and an AddressablesBuilder. We will also create an installer for the AddressablesManager on our DI folder. Of course, the installer should reference the AddressableManager and then be added to the project context. Keep in mind that for the system to work, you will also need a WhateverDev's Core version scriptable and its installer added to the project context.
The Addressable Version Dependence library needs a reference to the Version scriptable. After setting it you will see an inspector with a settings button.
If you see a ui that tells you to create a manifest for a default group, that group may not be correctly ignored. It should of course be ignored because you shouldn't actually create any addressables on the default group. You can see the name of the default group on the Addressables Groups window and can add it to the Version Dependence settings so it will be ignored. You can do the same in the future for any groups you want to ignore.
After that, you should only see the settings button and that scriptable is ready to go.
The other one you need to setup is the Addressable Manager, which is the one that will handle the addressables in runtime. It just needs a reference to the Version Dependence Library.
After this, you are setup and ready to work with addressables.
Build hooks
There are a couple of build hooks that can be relevant to use when working with Addressables. If you are not using build hooks, you can create the library With WhateverDevs/Build/Create Processor Hooks Library.
Now let's two hooks on the folder Data/BuildHooks. One is the WarnAboutBuildBundlesBeforeBuild, which you will find in Create/WhateverDevs/SceneManagement/Build Hooks.
The other one comes with the core, it's a hook to copy a folder to the build folder, we can use it to copy the Bundles folder we setup. You can find it on Create/WhateverDevs/BuildHooks/CopyFolder.
The Copy Folder hooks needs you to select the folder you will want to be copied. In our case, we select the folder Bundles.
Finally, you need to add the warning hook to pre build and the copy folder to post build.
Scene Management
You need two scriptables to be able to work with scenes. The first one is the SceneManager, which you can create from WhateverDevs/SceneManagement/Create Scene Manager. This will create the Scene Manager at a specific location on Data/SceneManagement/SceneManager.asset. While you can rename it or move it, we recommend leaving it there since some classes will autoget the reference and you would have to assign it manually otherwise.
The other one is its installer, which you can find on Create/WhateverDevs/DI/Scene Manager. The Installer needs a reference to the SceneManager and of course has to be added to the project context.
After creating this two scriptables, you are ready to work with scenes.