Story box appears when called, disappears when clicked

This commit is contained in:
henriquenakashima 2020-09-27 22:04:05 -04:00
parent 8eecb71a38
commit 8119482922
4 changed files with 12 additions and 101 deletions

View file

@ -11,11 +11,16 @@ public class StoryBox : MonoBehaviour {
private bool clicked;
void Awake() {
this.gameObject.SetActive(false);
}
void Start() {
this.button.onClick.AddListener(NotifyOnClick);
}
public IEnumerator Display(string message) {
this.gameObject.SetActive(true);
this.clicked = false;
this.text.text = message;
while (!this.clicked) {
@ -25,5 +30,6 @@ public class StoryBox : MonoBehaviour {
private void NotifyOnClick() {
this.clicked = true;
this.gameObject.SetActive(false);
}
}