public void DeleteWord() { string word = EventSystem.current.currentSelectedGameObject.transform.parent.gameObject.name; bool inUse = controller.WordInUse(word); if (controller.DeleteWord(word)) { if (inUse) { Debug.Log("DELETE: Deleting a word in use!"); controller.DeleteInvalidPlayEntries(); } successModal.SetActive(true); deleteModal.SetActive(false); // Destroy the panel belonging to the word entry Destroy(activePanel); //activePanel.SetActive(false); contentTransform.sizeDelta = new Vector2(contentTransform.rect.width, contentTransform.rect.height - (yOffSet)); } else { deleteModal.SetActive(false); //TODO: THROW AN ERROR Debug.Log("ERROR: delete word failed"); } }