Story box appears when called, disappears when clicked
This commit is contained in:
parent
8eecb71a38
commit
8119482922
4 changed files with 12 additions and 101 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue