| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class selectCategoriesPanelController : MonoBehaviour
- {
- [SerializeField] Button OpenDialogButton;
- [SerializeField] GameObject SelectCategoriesDialog;
- [SerializeField] Text SelectCategoriesText;
- private SelectCategoryScript selectCategoryScript;
- // Start is called before the first frame update
- void Start()
- {
- OpenDialogButton.onClick.AddListener(ShowDialog);
- selectCategoryScript = SelectCategoriesDialog.GetComponent<SelectCategoryScript>();
- SelectCategoriesText.text = string.Format(LocalizationManager.Instance.GetText("SELECT_CATEGORIES_TEXT"),
- LocalizationManager.Instance.GetText("ALL"));
- }
- // Update is called once per frame
- void Update()
- {
- if (SelectCategoriesText.text.Contains("{")) {
- SelectCategoriesText.text = string.Format(LocalizationManager.Instance.GetText("SELECT_CATEGORIES_TEXT"),
- LocalizationManager.Instance.GetText("ALL"));
- }
- }
- public void UpdateCategoryText() {
- SelectCategoriesText.text = string.Format(LocalizationManager.Instance.GetText("SELECT_CATEGORIES_TEXT"), selectCategoryScript.GetCategoriesSelectedCount());
- }
- internal void ShowDialog() {
- SelectCategoriesDialog.SetActive(true);
- }
- public List<CategoryPanel.Category> GetSelectedCategories() {
- List<CategoryPanel.Category> selectedCategories = selectCategoryScript.GetSelectedCategories();
- return selectedCategories;
- }
- }
|