Hello, I'm trying to load a text file that contains JSON data as a TextAsset. This works fine if the extension of .txt is used,
For example myJson.txt works with:
TextAsset t = (TextAsset) Resources.Load("myJson", typeof(TextAsset));
However, when the extension is changed to .json, the resource will not load. How can we load the file as a TextAsset despite the .json extension? Is there a better way to load text from a file on runtime?
I think you are fine with the code, the problem is support:
Text Assets are a format for imported text files. When you drop a text file into your Project Folder, it will be converted to a Text Asset. The supported text formats are:
.txt .html .htm .xml .bytes
Something to ask be added as it is a more common "text" file format now.