IEnumerator RevertGroupJoin(bool success) { yield return(new WaitForSeconds(3)); SuccessJoinGroup.SetActive(false); ErrorJoinGroup.SetActive(false); JoinGroupB.SetActive(true); if (success) { GoToGroups(); } }
// refactor and make more abstract all this code public void ResultGroupJoin(bool success) { LoadingJoinGroup.SetActive(false); if (success) { SuccessJoinGroup.SetActive(true); } else { ErrorJoinGroup.SetActive(true); } StartCoroutine(RevertGroupJoin(success)); }