Hey! I've got back to unity after month, and I'm trying to make an object that would say something to you, when you click on it. I have a MessageBox panel which has background, animated sprite and a label. Then I have this script on the Item I'm clicking:
public string text;
public GameObject MessageBox;
public UILabel label;
// Use this for initialization
void Start () {
}
void OnMouseDown () {
NGUITools.SetActive(MessageBox,true);
label.text = text;
Debug.Log("Hello");
}
}
Also on the panel there is script:
void LateUpdate () {
if (Input.anyKeyDown) {
label.text = "";
NGUITools.SetActive(thismessage,false);
}
}
to close the panel and clear the message.
When I run the game (with the panel disabled by default) and click the object, it only prints Hello!, but nothing else happens. Any ideas how to fix this?
EDIT: I would also like to know if it's possible to make a panel that would set the timescale to 0 whenever it's active. I've tried but failed.