Load .json from StreamingAssets using Addresable
Asked Answered
B

1

0

Hello.

As per Addresable documentation “You can continue to load files from the StreamingAssets folder when you use the Addressables system. However, the files in this folder can’t be Addressable nor can they reference other assets in your project.”

So, if we don’t mark an asset as addressable, how can I tell Addressable system what/where to load?

Details:
My project needs a json file in build folder, used to override remote urls.
The json must ramain as it is, for easy editing.

Thank you.

Brouhaha answered 8/7, 2023 at 17:19 Comment(0)
T
0

You would not use the Addressable system to load this file, you would load it using normal C# IO.

E.G

var path = Application.dataPath + "/StreamingAssets/myfile.json"; // Windows and Editor path
var json = File.ReadAllText(path);
// Parse json

See this for info on the path Unity - Manual: Streaming Assets

Tog answered 11/7, 2023 at 12:59 Comment(1)

So, it's like "you can still load using other systems". Addresables system only knows about what's marked as addresable?

Brouhaha

© 2022 - 2024 — McMap. All rights reserved.