- Home /
Reading .txt file from Resources folder
Hi, got some problem with that:
TextAsset trans = (TextAsset)Resources.Load(language, typeof(TextAsset));
Next thing is to read line by line the file. It works fine in editor. Problems starts when I make a build and run it. No data is read! Whats up with that? It was my understanding that all data in Resources folders is included in build.
Comment
Answer by codemaker2015 · Oct 13, 2020 at 01:02 PM
I think you forgot to provide double quotes in the Load() method or the file is missing from the Resources folder.
Just try this one,
TextAsset data = (TextAsset)Resources.Load("filename", typeof(TextAsset));
Debug.Log("Data: " + data.text);