Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using AC;
- public class LanguajeSelection : MonoBehaviour
- {
- public Font myNewFont;
- public Font oldFont;
- private void OnEnable()
- {
- EventManager.OnChangeLanguage += OnChangeLanguage;
- }
- private void OnDisable()
- {
- EventManager.OnChangeLanguage -= OnChangeLanguage;
- }
- private void OnChangeLanguage(int languageIndex)
- {
- if (languageIndex == 2)
- {
- Menu[] allMenus = PlayerMenus.GetMenus().ToArray();
- foreach (Menu menu in allMenus)
- {
- Text[] texts = menu.canvas.GetComponentInChildren<Text>();
- foreach (Text text in texts)
- {
- text.font = myNewFont;
- }
- }
- Debug.Log("Aca tiene que cambiar la fuente");
- }
- else
- {
- Menu[] allMenus = PlayerMenus.GetMenus().ToArray();
- foreach (Menu menu in allMenus)
- {
- Text[] texts = menu.canvas.GetComponentInChildren<Text>();
- foreach (Text text in texts)
- {
- text.font = oldFont;
- }
- }
- Debug.Log("estamos parlando otra cosa asà que no se necesita cambiar a la normal");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement