public void OpenEditPanel(GameObject obj, bool newItem) { gameMngr.openListItem = obj; if (!newItem) { Button b = gameMngr.openListItem.transform.GetChild(0).gameObject.GetComponent <Button>(); gameMngr.curListItem = listMngr.curList[listMngr.CheckForDuplicateItem(b.transform.Find("Name").GetComponent <Text>().text, float.Parse(b.transform.Find("Value").GetComponent <Text>().text))]; editPanel.GetComponent <EditListItem>().PopulateEditPanel(gameMngr.curListItem); } else { editPanel.GetComponent <EditListItem>().ButtonPositions(); } }