38 lines
925 B
C#
38 lines
925 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ImageTranslator : MonoBehaviour{
|
|
|
|
public GameObject englishText;
|
|
|
|
public GameObject spanishText;
|
|
|
|
int language;
|
|
|
|
// Start is called before the first frame update
|
|
void OnEnable(){
|
|
language = PlayerPrefs.GetInt("Language");
|
|
if (language == 0){
|
|
englishText.SetActive(true);
|
|
spanishText.SetActive(false);
|
|
}
|
|
if (language == 1){
|
|
englishText.SetActive(false);
|
|
spanishText.SetActive(true);
|
|
}
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update(){
|
|
if (language == 0){
|
|
englishText.SetActive(true);
|
|
spanishText.SetActive(false);
|
|
}
|
|
if (language == 1){
|
|
englishText.SetActive(false);
|
|
spanishText.SetActive(true);
|
|
}
|
|
}
|
|
}
|