private void handleButtonPress(string buttonName) { if (buttonName != null && highlightedGO != null) { Transform t = highlightedGO.transform.Find(buttonName); ButtonGoScript script = t.gameObject.GetComponent <ButtonGoScript>(); // corrosponding character of button string ch = script.getCurrentChar(); script.animatePress(); if (onCharInput != null) { onCharInput(ch); } } }
private void toggleButtonChar() { foreach (GameObject categorie in categorieObjList) { for (int i = 1; i <= catButtonCount; i++) { try { Transform t = categorie.transform.Find("Button" + i); ButtonGoScript script = t.gameObject.GetComponent <ButtonGoScript>(); script.toggleChars(); } catch (Exception e) { Debug.LogError(e.Message); } } } }