| 123456789101112131415161718192021222324252627282930313233343536373839 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class CategorySelection : MonoBehaviour
- {
- [SerializeField] Text CategoryNameText;
- [SerializeField] Toggle selectionToggle;
- // Start is called before the first frame update
- void Start()
- {
-
- }
- // Update is called once per frame
- void Update()
- {
-
- }
- internal void SetCategoryText(string categoryName, int questionCount) {
- CategoryNameText.text = categoryName + " (" + questionCount + ")";
- }
- internal void SetSelected(bool selected) {
- selectionToggle.SetIsOnWithoutNotify(selected);
- }
- public string getCategoryName() {
- string catText = CategoryNameText.text;
- return catText.Substring(0, catText.IndexOf('(') - 1);
- }
- public bool isSelected() {
- return selectionToggle.isOn;
- }
- }
|