- Home /
Fetching localized resources.
Hi, I'm looking into the possibilities for creating a localized resource system.
Prefferable end goal being something like this:
Resources
> en
> > audio_clip_name
> no
> > audio_clip_name
And I have managed to get that working using this simple piece of code:
public static T Get<T>(T resourceToFind, SystemLanguage language) where T : Object
{
string localizedPath = string.Format(
"{0}/{1}", GetLanguagePath(language), resourceToFind.name
);
return Resources.Load<T>(localizedPath);
}
However, I would also like to try support having several folder structures. Is there some way to do something like
AssetDatabase.GetPath(resourceToFind)
during runtime using
or something else that is not editor only?
Answer by Ledii · May 11, 2019 at 01:21 PM
I have fiddled a bit more, and found an acceptable solution for now at least. I ended up supplying sub-directories as a parameter, and constructing the path from that.
Your answer
![](https://koobas.hobune.stream/wayback/20220612201158im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to load resources from www in loading scene time? 2 Answers
How to optimize script that joins objects (problem with Physics.OverlapBox) 0 Answers
Buy with one click IAP 0 Answers
Resources.Load() What has to be in Resources Folder 1 Answer
A problem regarding to player animation with checkpoint in 2D platformer 0 Answers