The string “key” variable all over the documentation is a great source of confusion for most people, or at least that is what I am reading in Unity forums in plain English language.
So here is a simple explanation where to get it:
https://docs.unity3d.com/Packages/com.unity.addressables@1.19/manual/InstantiateAsync.html
See attached screenshot.
public void load()
{
Caching.ClearCache();
string key = “Assets/RPGCombatSystem/Prefabs/Player.prefab”;
Addressables.LoadAssetAsync(key).Completed+=(async)=>
{
Debug.Log(“Async asset load done!!!”);
//SceneManager.UnloadSceneAsync(“loadingscene”);
};
}
Basically the relative /Asset/… path for any Addressable item including scenes. Could this path be arbitrarily placed anywhere else, I would say “I do not want to find that out!”. So I am quite contented with this way of setting up the key variable.
Dara
