void MakeNewDialog(string newDialog) { DialogObject newDialogObject = Instantiate(dialogPrefab, dialogHolder.transform) .GetComponent <DialogObject>(); newDialogObject.Setup(newDialog); }
IEnumerator MakeNewDialog(string newDialog) { // Instantiates the dialog object (the prefab) on the dialog holder scrollInProgress = true; DialogObject newDialogObject = Instantiate(dialogPrefab, dialogHolder.transform).GetComponent <DialogObject>(); StartCoroutine(ScrollCo()); float r = newDialogObject.Setup(newDialog); yield return(new WaitForSeconds(r)); scrollInProgress = false; afterDialog(); }