private void SetScrollView() { foreach (QuestionDataBase questionDataBase in QuestionDataBaseManager.Instance.QuestionDataBases) { GameObject newContentElement = Instantiate(QuestionBaseContentElementPrefab, Content); QuestionDataBaseScrollViewElement newContentElementScript = newContentElement.GetComponent <QuestionDataBaseScrollViewElement>(); newContentElementScript.SetQuestionBase(questionDataBase); newContentElementScript.ChooseBaseToggle.group = ContentToggleGroup; newContentElementScript.ChooseBaseToggle.onValueChanged.AddListener( delegate { ContentElementOnToggled(newContentElementScript.ChooseBaseToggle, newContentElementScript); }); newContentElementScript.EditButton.onClick.AddListener( delegate { ContentElementOnEdit(newContentElementScript.QuestionDataBase); }); newContentElementScript.ResetButton.onClick.AddListener( delegate { ContentElementOnReset(newContentElementScript); }); newContentElementScript.DeleteButton.onClick.AddListener( delegate { ContentElementOnDelete(newContentElementScript); }); } }
private void ContentElementOnToggled(bool value, QuestionDataBaseScrollViewElement questionBaseContentElement) { if (value) { SelectedBase = questionBaseContentElement; } }
public override void OnEnable() { SelectedBase = null; UIManager.Instance.Background.DisableAll(); UIManager.Instance.Background.BackButton.gameObject.SetActive(true); UIManager.Instance.Background.SetBackButtonListener(UIManager.Instance.GoBack); ClearScrollView(); SetScrollView(); }
private void ContentElementOnReset(QuestionDataBaseScrollViewElement contentElement) { YesOrNo.SetFromChooseBaseResetButton(contentElement.QuestionDataBase); UIManager.Instance.GoToView(YesOrNo); }