I was wondering how are Addressablesbetter than file ReadAllText and ReadAllBytes?
When it comes to text assets, i use this:
SomeStruct someStruct = JsonUtility.FromJson(File.ReadAllText(“weaponData.json”));
Where in case of addressables, it would take:
IEnumerator SomeCoroutine()
{
AsyncOperationHandle dataHandle = Addressables.LoadAssetAsync(“weaponData.json”);
yield return new WaitWhile(() => !dataHandle.IsDone);
SomeStruct someStruct = JsonUtility.FromJson(dataHandle.Result.ToString());
}
so it takes
- more lines
- coroutine
- creates async operation handle
- creates object of type TextAsset
- creates string
not a good deal if you ask me, but I dont know enough about addressables to be 100% sure about it.
I still use addressables to load 3D models however im not sure when should I use addressables and when File.ReadAllText and ReadAllBytes are better.
what do you think? i mainly care about performance