public void LetterWasNotCollected(FallingLetter _fallingLetter) { // THIS IS NOT WORKING CORRECTLY NEED TO DO IT A DIFFERENT WAY fallingLettersPool.Add(_fallingLetter); fallingObjects.Remove(_fallingLetter); // Debug.Log("adding the letter:" + _fallingLetter.letter + " back to the pool"); }
public void LetterCollected(FallingLetter _fallingLetter) { collectedObjects.Add(_fallingLetter); fallingObjects.Remove(_fallingLetter); var letterValue = word.IndexOf(_fallingLetter.letter, StringComparison.Ordinal); Assert.IsTrue(letterAnimators.Count == 5, "letterAnimators must have references to the animators for b,o,n,u,s"); var animatorRef = letterAnimators[letterValue]; animatorRef.ShowCollected(); if (collectedObjects.Count >= 5) { StartAllLettersCollected(); } else { PlaySound(SoundList.BONUSLetterCollected); // animate the letter collected } }