void Start() { if (GameObject.Find("Spider") == null) { conversation = finalMonologue; speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); speakerUILeft.Speaker = conversation.speakerLeft; speakerUIRight.Speaker = conversation.speakerRight; AdvanceConversation(); return; } if (File.Exists(Application.persistentDataPath + @"\saveFile.bin")) { saveManager = FindObjectOfType <SaveManager>(); } conversation = plot.plot[saveManager.saveInfo.dialogNumber]; speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); speakerUILeft.Speaker = conversation.speakerLeft; speakerUIRight.Speaker = conversation.speakerRight; saveManager.saveInfo.dialogNumber++; AdvanceConversation(); }
void DisplayLine() { Line line = dialogue.lines[activeLineIdx]; DialogueCharacter character = line.character; if (speakerUILeft.CompareSpeaker(character)) { activeSpeakerUI = speakerUILeft; SetDialogue(speakerUILeft, speakerUIRight, line.text); } else { activeSpeakerUI = speakerUIRight; SetDialogue(speakerUIRight, speakerUILeft, line.text); } if (dialogue.lines[activeLineIdx].hasVoceOver) { voiceLineManager.PlayClip(dialogue.lines[activeLineIdx].voiceLine); totalDelay = voiceLineManager.LengthOfClip(0) + delayAfterFinishedLine; } else { totalDelay = activeSpeakerUI.AnticipatedTypingTime() + delayAfterFinishedLine; } }
/// <summary> /// Show the speaker's UI, hide the other's UI /// </summary> /// <param name="activeSpeakerUI">speaker</param> /// <param name="inactiveSpeakerUI">listener</param> /// <param name="text">speaker's line</param> void SetDialogue(SpeakerUI activeSpeakerUI, SpeakerUI inactiveSpeakerUI, string text) { inactiveSpeakerUI.Hide(); activeSpeakerUI.Show(); StopAllCoroutines(); StartCoroutine(TypeSentence(activeSpeakerUI, text)); }
public static event Action <bool> QuestStatus; //Added by Drew void Start() { followupQuestion = questionManager.GetComponent <QuestionManager>(); speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); }
void Start() { speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); speakerUILeft.Speaker = conversation.speakerLeft; speakerUIRight.Speaker = conversation.speakerRight; }
private void Start() { speakerLeftUI = speakerLeft.GetComponent <SpeakerUI>(); speakerRightUI = speakerRight.GetComponent <SpeakerUI>(); lines = new Queue <Line>(); }
private void SetDialog(SpeakerUI activeSpeakerUI, SpeakerUI inactiveSpeakerUI, Line line) { activeSpeakerUI.Dialog = line.text; activeSpeakerUI.Show(); inactiveSpeakerUI.Hide(); activeSpeakerUI.animator.Play(line.emotion.ToString()); }
void SetDialog(SpeakerUI Active, SpeakerUI Inactive, string text, int imdex, int imdexTwo, AudioClip voice) { Active.Dialogue = text; Active.Show(); Active.clip = voice; Inactive.Hide(); Active.ConversationText(imdex, imdexTwo, voice); }
void SetDialogue(SpeakerUI activeSpeakerUI, SpeakerUI inactiveSpeakerUI, string text) { activeSpeakerUI.Dialogue = text; activeSpeakerUI.Show(); inactiveSpeakerUI.Hide(); }
public void SetDialog(SpeakerUI activeSpeakerUI, SpeakerUI inactiveSpeakerUI, string text) { activeSpeakerUI.Show(); inactiveSpeakerUI.Hide(); StopAllCoroutines(); StartCoroutine(EffectTypewriter(text, activeSpeakerUI)); }
private void Awake() { speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); InitialiseConversation(null); OnNewConversation += InitialiseConversation; }
//poorly named: this one is for initially setting up speaker UI public void SetDialogue(Dialogue dialogue) { this.dialogue = dialogue; speakerUILeft.Speaker = this.dialogue.leftSpeaker; speakerUIRight.Speaker = this.dialogue.rightSpeaker; activeSpeakerUI = speakerUILeft; transmissionStart.Raise(); }
private IEnumerator TypeSentence(string sentence, SpeakerUI speaker) { speaker.Dialog = ""; foreach (char letter in sentence) { speaker.Dialog += letter; yield return(null); } }
//Get speakersUI instances and find quaetion controller if this is not given private void Awake() { speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); if (questionController == null) { questionController = FindObjectOfType <QuestionController>(); } }
void setDialog( SpeakerUI activeSpeakerUI, SpeakerUI inactiveSpeakerUI, string text ) { activeSpeakerUI.Dialog = text; activeSpeakerUI.Show(); }
public void SetDialogue(Dialogue dialogue, InteractibleNPC interacting) { this.dialogue = dialogue; speakerUILeft.Speaker = this.dialogue.leftSpeaker; speakerUIRight.Speaker = this.dialogue.rightSpeaker; interactingNPC = interacting; activeSpeakerUI = speakerUILeft; }
IEnumerator EffectTypewriter(string text, SpeakerUI activeSpeakerUI) { activeSpeakerUI.Dialog = ""; foreach (char character in text.ToCharArray()) { activeSpeakerUI.Dialog += character; yield return(null); } }
//hotdog void Start() { speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); familyBarUI = familyBar.GetComponent <FamilyBarUI>(); bossBarUI = bossBar.GetComponent <BossBarUI>(); Initialize(); index++; StartCoroutine(Type()); }
void Start() { speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); speakerUILeft.Speaker = conversation.speakerLeft; speakerUILeft.Speaker = conversation.speakerRight; play = FindObjectOfType <PlayDayController>(); }
void Start() { speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); speakerUILeft.Speaker = conversation.speakerLeft; speakerUIRight.Speaker = conversation.speakerRight; myPlayer = player.GetComponent <CharacterController2D>(); }
void Start() { continueDialogueButon.SetActive(false); speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); speakerUILeft.Speaker = dialogue.leftSpeaker; speakerUIRight.Speaker = dialogue.rightSpeaker; activeSpeakerUI = speakerUILeft; }
void Start() { DialogueTrigger dialogueTrigger = FindObjectOfType <DialogueTrigger>(); Dialogue conversation = dialogueTrigger.dialogue; speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); speakerUILeft.Speaker = conversation.speakerLeft; speakerUIRight.Speaker = conversation.speakerRight; }
private void Start() { speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); speakerUILeft.Speaker = conversation.speakerLeft; speakerUIRight.Speaker = conversation.speakerRight; AdvanceConversation(); continueButton.SetActive(true); }
void Start() { speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); speakerUILeft.Speaker = dialogue.leftSpeaker; speakerUIRight.Speaker = dialogue.rightSpeaker; activeSpeakerUI = speakerUILeft; voiceLineManager = AudioManager.instance.soundManager_voiceLines; }
/// <summary> /// Outputting a string letter by letter with a delay /// </summary> /// <param name="activeSpeakerUI">speaker</param> /// <param name="text">speaker's line</param> /// <returns>letters with a delay of 3 frames</returns> IEnumerator TypeSentence(SpeakerUI activeSpeakerUI, string text) { activeSpeakerUI.Dialog = ""; foreach (char letter in text.ToCharArray()) { activeSpeakerUI.Dialog += letter; yield return(new WaitForEndOfFrame()); yield return(new WaitForEndOfFrame()); yield return(new WaitForEndOfFrame()); } }
void Start() { speakerUILeft = speakerLeft.GetComponent <SpeakerUI>(); speakerUIRight = speakerRight.GetComponent <SpeakerUI>(); speakerUILeft.Speaker = conversation.speakerLeft; speakerUIRight.Speaker = conversation.speakerRight; DisplayLine(); AdvanceConversation(); }
public void DisplayLine() { Line line = dialogue.lines[activeLineIdx]; DialogueCharacter character = line.character; if (speakerUILeft.CompareSpeaker(character)) { activeSpeakerUI = speakerUILeft; SetDialogue(speakerUILeft, speakerUIRight, line.text); } else { activeSpeakerUI = speakerUIRight; SetDialogue(speakerUIRight, speakerUILeft, line.text); } }
//Show/Hide speaker and set its attributes //@param activeSpeakerUI speaker that will be displayed in GUI //@param inactiveSpeakerUI speaker that will be hidden in GUI //@param text dialogue text //@param character actual character that says the line void SetDialog(SpeakerUI activeSpeakerUI, SpeakerUI inactiveSpeakerUI, string text, Character character) { if (rightToLeft) { activeSpeakerUI.fullName.alignment = TextAlignmentOptions.MidlineRight; activeSpeakerUI.fullName.isRightToLeftText = true; activeSpeakerUI.dialog.alignment = TextAlignmentOptions.TopRight; activeSpeakerUI.dialog.isRightToLeftText = true; } StartCoroutine(ShowText(activeSpeakerUI, text, textDelay, character)); activeSpeakerUI.FullName = character.fullName; activeSpeakerUI.Show(); inactiveSpeakerUI.Hide(); }
void Start() { audios = GetComponent <AudioSource>(); speakerUILeft = Left.GetComponent <SpeakerUI>(); speakerUIRight = Right.GetComponent <SpeakerUI>(); if (!m) { player = GameObject.FindGameObjectWithTag("Player"); Gun = GameObject.FindGameObjectWithTag("WH"); } StarDialogue(conversation); //speakerUILeft.Speaker = conversation.Left; //speakerUIRight.Speaker = conversation.Right; }
//Function used to create typewritter effect //@param activeSpeakerUI speaker that will be displayed in GUI //@param fulltext dialogue text //@param delay delay of each letter when displayed in dialogues //@param character actual character that says the line IEnumerator ShowText(SpeakerUI activeSpeakerUI, string fullText, float delay, Character character) { displayingText = true; string textToDisplay = CheckOverflolwInText(fullText, character); for (int i = 0; i <= textToDisplay.Length; i++) { if (displayingText) { activeSpeakerUI.Dialog = textToDisplay.Substring(0, i); yield return(new WaitForSeconds(delay)); } else { activeSpeakerUI.Dialog = textToDisplay; break; } } displayingText = false; }