예제 #1
0
 // Start is called before the first frame update
 void Start()
 {
     _audioSource = GetComponent <AudioSource>();
     if (_data != null)
     {
         _textReader   = TextAssetReaderFactory.CreateReader(_data.ResourceType);
         _wordsQueue   = _textReader.ReadFile(_data.WordsFile);
         typingManager = new TypingManager(GetNextWord());
         UIManager.instance.UpdateText(typingManager.GetCurrentWord());
         FindObjectOfType <InputHandler>().AssignOnInputListener(CheckPlayerInput);
     }
     else
     {
         throw new System.Exception("No data file assigned");
     }
 }
예제 #2
0
 // Start is called before the first frame update
 void Start()
 {
     display       = gameObject.GetComponent <Text>();
     typingManager = GetComponent <TypingManager>();
     display.text  = typingManager.words[0].text;
 }