/// <summary> 弹出左侧对话 </summary> public static void PopLeftChat(ChatManager cm) { // 左侧有对话 if (cm.m_leftChats.Count > 0) { // 隐藏选择面板 ChoicePanle.HideChoicePanel(cm.m_view); cm.m_timer += Time.deltaTime; // 若左侧对话不为空,且计时器时间到,继续下一句. while (cm.m_leftChats.Count > 0 && cm.m_timer >= 1.5f) { string leftChat = cm.m_leftChats.Peek(); if (leftChat.Equals("游戏结束")) { cm.m_isGameOver = true; } BubbleController.PopBubble(cm.m_view, leftChat, cm.m_view.m_SoundManager.m_leftAudio); cm.m_leftChats.Dequeue(); cm.m_timer = 0f; } } // 左侧没有对话 else { if (cm.m_view.m_HasRightChat) { ChoicePanle.HideChoicePanel(cm.m_view); // 右侧没有对话 } else { ChoicePanle.ShowChoicePanel(cm.m_view); // 右侧有对话 } } }
/// <summary> 右侧对话,没有等待时间 </summary> public static void ReplayMessage(View view, string message) { // 弹出新对话 BubbleController.PopBubble(view, message, view.m_SoundManager.m_rightAudio); // 隐藏选择面板 ChoicePanle.HideChoicePanel(view); view.m_HasRightChat = true; }