void OpenDialog() { string textRef = dialogTexts[mCurIndex].GetStringRef(); if (!string.IsNullOrEmpty(textRef)) { if (clearModals.Value) { var uiMgr = ModalManager.main; if (uiMgr.GetTop() != modal.Value) { uiMgr.CloseAll(); } } if (usePortrait.Value) { ModalDialog.OpenApplyPortrait(modal.Value, portrait.Value as Sprite, nameText.GetStringRef(), textRef, OnDialogNext); } else { ModalDialog.Open(modal.Value, nameText.GetStringRef(), textRef, OnDialogNext); } mIsNext = false; } else { mCurIndex++; mIsNext = true; } }
public void OpenDialogPortrait(Sprite portrait, string nameTextRef, string dialogTextRef) { if (!string.IsNullOrEmpty(modalDialog)) { ModalDialog.OpenApplyPortrait(modalDialog, portrait, nameTextRef, dialogTextRef, NextPage); } else { ModalDialog.OpenApplyPortrait(portrait, nameTextRef, dialogTextRef, NextPage); } mIsDialogOpen = true; }
IEnumerator DoPlay() { for (int i = 0; i < dialogTextRefs.Length; i++) { string textRef = dialogTextRefs[i]; if (string.IsNullOrEmpty(textRef)) { continue; } mIsNext = false; if (applyPortrait) { ModalDialog.OpenApplyPortrait(modal, portrait, nameTextRef, textRef, OnDialogNext); } else { ModalDialog.Open(modal, nameTextRef, textRef, OnDialogNext); } while (!mIsNext) { yield return(null); } } if (M8.ModalManager.main.IsInStack(modal)) { M8.ModalManager.main.CloseUpTo(modal, true); } //wait for dialog to close while (M8.ModalManager.main.isBusy || M8.ModalManager.main.IsInStack(modal)) { yield return(null); } mPlayRout = null; }
void OpenDialog() { string textRef = dialogTexts[mCurIndex].GetStringRef(); if (!string.IsNullOrEmpty(textRef)) { if (usePortrait.Value) { ModalDialog.OpenApplyPortrait(modal.Value, portrait.Value as Sprite, nameText.GetStringRef(), textRef, OnDialogNext); } else { ModalDialog.Open(modal.Value, nameText.GetStringRef(), textRef, OnDialogNext); } mIsNext = false; } else { mCurIndex++; mIsNext = true; } }