/// <summary> /// Switches view mode, disabled and enables corresponding buttons. /// </summary> /// <param name="viewMode">view mode to switch to</param> private void SwitchViewMode(ViewMode viewMode) { this.viewMode = viewMode; var isEditing = viewMode == ViewMode.TeamEdit; WrapperFruitons.SetActive(isEditing); Filters.SetActive(isEditing); MyTeamGrid.AllowEdit = isEditing; ButtonDone.gameObject.SetActive(isEditing); WrapperTeams.SetActive(!isEditing); ButtonNewTeam.gameObject.SetActive(!isEditing); ButtonEdit.gameObject.SetActive(!isEditing); ButtonDelete.gameObject.SetActive(!isEditing); ButtonBack.gameObject.SetActive(!isEditing); switch (viewMode) { case ViewMode.TeamSelect: ResizeScrollContent(teams.Count); break; case ViewMode.TeamEdit: ReindexFruitons(); break; } }
private void SetupView() { WrapperFruitons.SetActive(true); Filters.SetActive(true); GameResultsPanel.gameObject.SetActive(false); MyTeamGrid.AllowEdit = false; ResizeScrollContent(new HashSet <int>(GameManager.Instance.AvailableFruitons).Count); }