private void HandleOptionSelected(HomeQuizOptionView optionView) { if (optionView.IsSelected) { if (OnQuizSelectedEvent != null) { OnQuizSelectedEvent(optionView.Data); } } }
private void AddQuizItem(QuizVO quiz) { HomeQuizOptionView optionView = _homeQuizOptionFactory.Create(); optionView.OptionSelectionChangedEvent += HandleOptionSelected; optionView.SetData(quiz); RectTransform optionTransform = optionView.gameObject.GetComponent <RectTransform>(); optionTransform.SetParent(container); optionTransform.localScale = Vector3.one; optionTransform.SetInsetAndSizeFromParentEdge(UnityEngine.RectTransform.Edge.Left, 0, container.rect.size.x); }