Quantcast
Channel: Latest Questions by Panopolos
Viewing all articles
Browse latest Browse all 18

Split Textasset into List

$
0
0
Hi there, I'm writing a Scrabble prototype for fun just to learn the ropes of scripting and I'm stuck at checking the spelled word against a dictionary. I've got a text document with a list of words separated by a new line. My original thought was to create an array of strings and have the game check the word spelled on the game board against these strings. At first when I was researching, I thought to use Array.Contains, but that function does not exist for the built-in array as I've found out, so I decided to have it check them manually. //Variable assignment public static string[] wordArray = new string[]; public TextAsset dict; //assigned in inspector //In Start() wordArray = dict.text.Split("\n"[0]); //In other script if (tilesPlaced) { for (int i=0; i

Viewing all articles
Browse latest Browse all 18

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>