using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; public class Localisation : MonoBehaviour { public int LanguageID; public Sprite[] Image; public int Type; private TMP_Text textLine; private Text TextN; public string[] text; private void Start() { LanguageID = PlayerPrefs.GetInt("LanguageID"); switch (Type) { case 0: textLine = GetComponent(); textLine.text = "" + text[LanguageID]; break; case 1: SpriteRenderer S = GetComponent(); S.sprite = Image[LanguageID]; break; case 2: TextN = GetComponent(); TextN.text = "" + text[LanguageID]; break; case 3: Image I = GetComponent(); I.sprite = Image[LanguageID]; break; } } public void ForSettings() { LanguageID = PlayerPrefs.GetInt("LanguageID"); textLine.text = "" + text[LanguageID]; } }