I want to read my level information using json files. Each level has an equal json file , for example level_1.json.
All of these files are located in the /Assets/Resources/Levels folder in unity.
The problem is the Resource.Load works fine in unity editor on pc, but when I build an apk file for android, everything stopped working an the level information can not be loaded.
Here is the code to load the level information
var levelFile = $"Levels/level_{LevelNo + 1}";
TextAsset level= Resources.Load<TextAsset>(levelFile);
if (level != null)
{
var currentLevel = JsonUtility.FromJson<Level>(level.text);
//the rest of my code
}
I read multiple threads with the same problem, but none of them fix my problem.