Example #1
0
    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();
    }
Example #2
0
    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;
        }
    }
Example #3
0
 /// <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>();
    }
Example #5
0
 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>();
    }
Example #7
0
 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();
 }
Example #10
0
    public void SetDialog(SpeakerUI activeSpeakerUI, SpeakerUI inactiveSpeakerUI, string text)
    {
        activeSpeakerUI.Show();
        inactiveSpeakerUI.Hide();

        StopAllCoroutines();
        StartCoroutine(EffectTypewriter(text, activeSpeakerUI));
    }
Example #11
0
    private void Awake()
    {
        speakerUILeft  = speakerLeft.GetComponent <SpeakerUI>();
        speakerUIRight = speakerRight.GetComponent <SpeakerUI>();
        InitialiseConversation(null);

        OnNewConversation += InitialiseConversation;
    }
Example #12
0
    //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();
    }
Example #13
0
 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>();
     }
 }
Example #15
0
 void setDialog(
     SpeakerUI activeSpeakerUI,
     SpeakerUI inactiveSpeakerUI,
     string text
     )
 {
     activeSpeakerUI.Dialog = text;
     activeSpeakerUI.Show();
 }
Example #16
0
    public void SetDialogue(Dialogue dialogue, InteractibleNPC interacting)
    {
        this.dialogue          = dialogue;
        speakerUILeft.Speaker  = this.dialogue.leftSpeaker;
        speakerUIRight.Speaker = this.dialogue.rightSpeaker;
        interactingNPC         = interacting;

        activeSpeakerUI = speakerUILeft;
    }
Example #17
0
 IEnumerator EffectTypewriter(string text, SpeakerUI activeSpeakerUI)
 {
     activeSpeakerUI.Dialog = "";
     foreach (char character in text.ToCharArray())
     {
         activeSpeakerUI.Dialog += character;
         yield return(null);
     }
 }
Example #18
0
    //hotdog

    void Start()
    {
        speakerUILeft  = speakerLeft.GetComponent <SpeakerUI>();
        speakerUIRight = speakerRight.GetComponent <SpeakerUI>();
        familyBarUI    = familyBar.GetComponent <FamilyBarUI>();
        bossBarUI      = bossBar.GetComponent <BossBarUI>();
        Initialize();
        index++;
        StartCoroutine(Type());
    }
Example #19
0
    void Start()
    {
        speakerUILeft  = speakerLeft.GetComponent <SpeakerUI>();
        speakerUIRight = speakerRight.GetComponent <SpeakerUI>();

        speakerUILeft.Speaker = conversation.speakerLeft;
        speakerUILeft.Speaker = conversation.speakerRight;

        play = FindObjectOfType <PlayDayController>();
    }
Example #20
0
    void Start()
    {
        speakerUILeft  = speakerLeft.GetComponent <SpeakerUI>();
        speakerUIRight = speakerRight.GetComponent <SpeakerUI>();

        speakerUILeft.Speaker  = conversation.speakerLeft;
        speakerUIRight.Speaker = conversation.speakerRight;

        myPlayer = player.GetComponent <CharacterController2D>();
    }
Example #21
0
    void Start()
    {
        continueDialogueButon.SetActive(false);
        speakerUILeft  = speakerLeft.GetComponent <SpeakerUI>();
        speakerUIRight = speakerRight.GetComponent <SpeakerUI>();

        speakerUILeft.Speaker  = dialogue.leftSpeaker;
        speakerUIRight.Speaker = dialogue.rightSpeaker;

        activeSpeakerUI = speakerUILeft;
    }
Example #22
0
    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;
    }
Example #23
0
    private void Start()
    {
        speakerUILeft  = speakerLeft.GetComponent <SpeakerUI>();
        speakerUIRight = speakerRight.GetComponent <SpeakerUI>();

        speakerUILeft.Speaker  = conversation.speakerLeft;
        speakerUIRight.Speaker = conversation.speakerRight;

        AdvanceConversation();

        continueButton.SetActive(true);
    }
Example #24
0
    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;
    }
Example #25
0
    /// <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();
    }
Example #27
0
    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;
    }