示例#1
0
    IEnumerator deliverBoth()
    {
        //Door Knock
        NPCGrandmaSource.clip = NPCGrandmaDialog[0];
        NPCGrandmaSource.Play();
        yield return(new WaitForSeconds(NPCGrandmaSource.clip.length));

        NPCGrandmaSource.clip = NPCGrandmaDialog [4];
        NPCGrandmaSource.Play();
        _questLogic.NPCDialog.text = "Grandmother: Well hello dearie!";
        yield return(new WaitForSeconds(NPCGrandmaSource.clip.length));

        NPCGrandmaSource.clip = NPCGrandmaDialog [5];
        NPCGrandmaSource.Play();
        _questLogic.NPCDialog.text = "Grandmother: A package from my granddaughter? Why thank you!";
        yield return(new WaitForSeconds(NPCGrandmaSource.clip.length));

        Destroy(boxForGrandma);
        NPCGrandmaSource.clip = NPCGrandmaDialog [9];
        NPCGrandmaSource.Play();
        _questLogic.NPCDialog.text = "Grandmother: And you brought me mushrooms! My favorite!";
        Destroy(_questLogic.mushroomIcon);
        Destroy(_questLogic.mushroomScoreBoard);

        yield return(new WaitForSeconds(NPCGrandmaSource.clip.length));

        NPCGrandmaSource.clip = NPCGrandmaDialog [8];
        NPCGrandmaSource.Play();
        _questLogic.NPCDialog.text = "Grandmother: Here's something for your troubles.";
        yield return(new WaitForSeconds(NPCGrandmaSource.clip.length));

        _questLogic.NPCDialog.text        = "";
        _questLogic.deliveryQuestActive   = false;
        _questLogic.mushroomQuestActive   = false;
        _questLogic.deliveryQuestInactive = true;
        _questLogic.mushroomQuestInactive = true;
        moneyBag.SetActive(true);
        yield return(new WaitForSeconds(3));

        _endGame.FadeToEnd();
    }