How can I update and build an updated version? Afaik, If I make a new build, It breaks the link to the catalog, and the game cannot use the updated version.
I think it is impossible for now. Addressables does not support multiple environment build like Dev, Int, UAT, and PROD using “Update a previous build” option.
namespace ForAddressable
{
public class Settings
{
public static string RemoteAddress;
}
}
Set Addressable Profiles / Remote / Custom / Remote.LoadPath as {ForAddressable.Settings.RemoteAddress}
Don’t forget [ ] is used at build stage, {} is used at runtime.
Make a new build. Addressable Groups/Build/New Build/Default Build Script.
Set your address before you load anything. You may need to clear the cache on the editor.
public enum Targets
{
Dev,
Prod
}
public Targets Target = Targets.Dev;
public bool ClearCache;
void Start()
{
#if UNITY_EDITOR
if (ClearCache)
{
Caching.ClearCache();
}
#endif
if (Target == Targets.Dev)
{
RemoteAddress= "http://localhost/MyGame/ServerData/WebGL";
}
else
{
RemoteAddress= "http://www.myserver.com/MyGame/ServerData/WebGL";
}
var asyncOperationHandle = Addressables.LoadSceneAsync(SceneReference, LoadSceneMode.Single);
asyncOperationHandle.Completed += AsyncOperationHandle_Completed;
Debug.LogFormat("SceneInitialManager:Start:SceneLoading");
}
update your content
Update your build. Addressable Groups/Build/Update a previous Build. Select AddressableAssetsData/Platform/addressables_content_state.bin