using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class GameHangManLetter : MonoBehaviour { char charThis; public void SetLetter(char let) { charThis = let; charThis = char.ToUpper(charThis); transform.Find("txtLetter").GetComponent().text = charThis.ToString(); } public void ChooseLetter() { if (GameObject.Find("ControllerHangMan").GetComponent().ChooseLetter(charThis)) { GameObject.Find("ControllerHangMan").GetComponent().CreateSeparator(transform.GetSiblingIndex()); Destroy(gameObject); } else { Destroy(transform.GetChild(0).gameObject); GetComponent().color = new Color(1f, .22f, .28f, 1); } } }