Hi
I am trying to display text on mouse click but somehow it doesn’t show in gui.textarea.
thanks in advance for any help and suggestions on better ways.
here is my code:
public class ReadText : MonoBehaviour {
public TextAsset TestText1;
public TextAsset TestText2;
//public GameObject GB1;
//public GameObject GB2;
private string TextContent;
private string CtnShow;
// Use this for initialization
void Start () {
TextContent = " ";
}
// Update is called once per frame
void OnGUI () {
GUI.TextArea (new Rect (10, 10, 400, 200), TextContent, 480);
}
void OnMouseDown(){
if (tag == "En") {
TextContent = TestText1.text;
}
if (tag == "Fa") {
TextContent = TestText2.text;
}
}