public void UpdateDialogText(string text, string owner, DialogPlacement placement, bool clear, bool isModal) { if (isModal) { UI.SetActive(false); } else { UI.SetActive(true); } if (clear) { ClearDialog(); } switch (placement) { case DialogPlacement.BottomLeft: BottonLeft.SetActive(true); ButtonLeftText.text = text; ButtonLeftOwner.text = owner; break; case DialogPlacement.BottomRight: BottomRight.SetActive(true); BottomRightText.text = text; BottomRightOwner.text = owner; break; case DialogPlacement.TopLeft: TopLeft.SetActive(true); TopLeftText.text = text; TopLeftOwner.text = owner; break; case DialogPlacement.TopRight: TopRight.SetActive(true); TopRightText.text = text; TopRightOwner.text = owner; break; case DialogPlacement.Top: Top.SetActive(true); TopText.text = text; TopOwner.text = owner; break; default: break; } }
/// <summary> /// Constructor with a list of dialog data, speed setting, and top/bottom positioning. Top/bottom /// positioning will override any auto-size/auto-center. /// </summary> /// <param name="dialogArg">List of dialog data</param> /// <param name="speedSetting">How fast to display the dialog</param> /// <param name="position">Top or bottom placement</param> public DialogBoxScreen(List<DialogData> dialogArg, DialogSpeed speedSetting, DialogPlacement position) { dialogList = dialogArg; dialogPlacement = position; dialogCounter = dialogList.Count; // Set the flags and variables usingMessageList = false; topBottomPosition = true; dialogCounter = -1; // Get the first message to display GetNextDialog(); IsPopup = true; // Set the delay timer to a default dialogSpeed = speedSetting; // If the speed is instant, skip ahead will be true if (dialogSpeed == DialogSpeed.Instant) textComplete = true; }