Alright, so I have this text file containing a bunch of words separated by a new line.
I intend to drag and drop this text file into Unity inspector, and then store the words inside into a string array.
Here’s what I have done:
public TextAsset asset;
public static string[] wordList = asset.text.Split('
');
It’s giving me an error, which could be fixed by making TextAsset asset static. But then I won’t be able to access it through the Inspector.
Apologies if this is a really newbie question. Can’t seem to find a way out…