using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; public class SpellingBeeController : MonoBehaviour { private List lines; // Start is called before the first frame update void Start() { lines = new List(); string path = "Assets/SpellingBee/words.txt"; StreamReader reader = new StreamReader(path); string line = ""; while ((line = reader.ReadLine()) != null) { lines.Add(line); } } // Update is called once per frame void Update() { int randomIndex = UnityEngine.Random.Range(0, lines.Count); string randomWord = lines[randomIndex]; Debug.Log(randomWord); } }