public void CheckKey(char letter) { if (letter == '\r' || letter == '\n') { ExecuteUI(); } else if (letter == '\b') { Backspace(); } else { letter = char.ToLower(letter); uiObjects = FindObjectsOfType <UIObject>(); if (hasactiveUI) { if (!activeUI.NameTyped() && activeUI.GetNextLetter() == letter) { SetSlider(activeName, activeUI.TypeLetter()); } } else { foreach (UIObject UI in uiObjects) { if (UI.GetNextLetter() == letter) { activeUI = UI; activeName = activeUI.GetName(); hasactiveUI = true; SetSlider(activeName, activeUI.TypeLetter()); break; } } } } }