Question by
ad50323924 · Dec 10, 2016 at 12:01 AM ·
localization
localize many UI texts in one scipt
Hey, I would like to use smart localization(https://www.assetstore.unity3d.com/en/#!/content/7543) to localize a game menu. But I found all the text are written in text component of the button rather than in the strings. Here is what I write to find those text and I was wondering what shall I do next.
using UnityEngine; using System.Collections; using UnityEngine.UI;
public class Translation : MonoBehaviour {
public Text[] instruction;
// Use this for initialization
void Start()
{
instruction = GetComponentsInChildren<Text>();
}
// Update is called once per frame
void Update () {
for (int i=0;i<instruction.Length;i++)
instruction[i].text = "Text you assign";
}
}
Comment