private void Accept() { for (int i = 0; i < activitiesContent.childCount; i++) { EventPanel eventPanel = activitiesContent.GetChild(i).GetComponent <EventPanel>(); if (eventPanel != null && (eventPanel.CheckAccept() || prevState == GameState.WAIT_ACTIVITY_CHOICE)) { eventPanel.Accept(); } } Close(); }
public void CheckAccept() { bool flag = false; for (int i = 0; i < activitiesContent.childCount; i++) { EventPanel eventPanel = activitiesContent.GetChild(i).GetComponent <EventPanel>(); if (eventPanel != null && eventPanel.CheckAccept()) { flag = true; } break; } if (flag) { acceptButton.gameObject.SetActive(true); } else { acceptButton.gameObject.SetActive(false); } }