void SetupGame() { //Clear racksf this isn't a new game _playRack.ClearRack(); _handRack.ClearRack(); string shuffledWord = _wordController.ShuffleWord(GetRepairWord()); _pidginText.text = GetCurrentPidgenWord(); //Create tiles d add them to Rack foreach (char c in shuffledWord) { GameObject clone = (GameObject)Instantiate(_letterButtonPrefab, Vector3.zero, transform.rotation); //GameObject clone = poolHebaviour.RequestGameObject(); clone.name = c.ToString(); LetterButton letterButton = clone.GetComponent <LetterButton>(); letterButton.Letter = c.ToString(); //TODO: Maybe directly add these tiles so it doesn't look visually weird _handRack.AddLetterButtonToFirstEmptySlot(letterButton); } _currentTimer.Begin(); SetProgressRatio(); }
public void LetterButtonTapped(LetterButton letterButton) { Debug.Log("LetterButtonTapped: " + letterButton.name); RemoveLetterButton(letterButton); _dependentRack.AddLetterButtonToFirstEmptySlot(letterButton); }