public SpeechBubble GetSpeechBubble(SpeechBubble.SPEECHBUBBLETYPE _type) { //Get one of the Speech Bubbles by type. for (int i = 0; i < m_speechBubbles.Count; i++) { if (m_speechBubbles[i].m_type == _type) { return(m_speechBubbles[i]); } } Debug.Log("ERROR: DialogueManager.GetSpeechBubble can't find Speech Bubble of type \"" + _type.ToString() + "\"."); return(null); }
public void StartConversation(Conversation _convo, SpeechBubble.SPEECHBUBBLETYPE _type) { //Begins a conversation using a speech bubble. //Debug.Log("DialogueManager.StartConversation("+_convo.m_dialogueType.ToString()+")."); mp_convo = _convo; mp_dlgType = mp_convo.m_dialogueType; mp_bubble = _type; ToggleSpeechBubble(mp_bubble, true); GetSpeechBubble(mp_bubble).m_T_name.text = _convo.m_speaker; mp_dlgIndex = -1; Button speechBubbleButton = GetSpeechBubble(mp_bubble).m_speechBubble.GetComponentInChildren <Button>(); if (speechBubbleButton) { speechBubbleButton.interactable = true; } DisplayNextSentence(); }
public void ToggleSpeechBubble(SpeechBubble.SPEECHBUBBLETYPE _type, bool _state) { //Toggles the visibility of a speech bubble. bool _found = false; for (int i = 0; i < m_speechBubbles.Count; i++) { if (m_speechBubbles[i].m_type == _type) { m_speechBubbles[i].m_speechBubble.SetActive(_state); _found = true; } } if (!_found) { Debug.Log("ERROR: DialogueManager.ToggleSpeechBubble(" + _type.ToString() + ", " + _state + ") can't find speech bubble of that type in m_speechBubbles."); } }