Example #1
0
 private void OnEnable()
 {
     player.DisableControls();
     player.EnableKey("interact");
     dialogue.ResetDialogue();
     dialogue.Play();
 }
Example #2
0
 private void YmirDialogue()
 {
     if (phase.Equals("ymir"))
     {
         if (ymirExplanation.activeInHierarchy)
         {
             if (player.GetInteractTrigger())
             {
                 if (!ymirDialogue.GetDialogueEnded())
                 {
                     if (ymirDialogue.GetEndLine())
                     {
                         ymirDialogue.Play();
                     }
                 }
                 else
                 {
                     canvasBlinkEyes.SetActive(false);
                     phase = "finish";
                     ymirExplanation.SetActive(false);
                     tutorial.SetActive(true);
                     gameObject.SetActive(false);
                 }
             }
         }
         else
         {
             ymirExplanation.SetActive(true);
             ymirDialogue.Play();
             player.EnableKey("interact");
         }
     }
 }
Example #3
0
 private void Update()
 {
     if (dialogue.activeInHierarchy)
     {
         if (!dialogueBox.GetDialogueEnded())
         {
             if (player.GetInteractTrigger() && dialogueBox.GetEndLine())
             {
                 dialogueBox.Play();
             }
         }
         else
         {
             dialogue.gameObject.SetActive(false);
             cam.SetActive(false);
             Invoke(nameof(EnableControl), 0.5f);
         }
     }
 }
Example #4
0
    private void OnEnable()
    {
        player.DisableControls();
        player.EnableKey("interact");

        InventoryObject auxInventory = inventory.GetMemories();

        foreach (ItemObject obj in auxInventory.inventory)
        {
            memoriesPlayer.Add(obj);
        }

        if (YmirExplanation.activeInHierarchy)
        {
            YmirDialogue.Play();
        }

        OfferedMemoriesBox.UpdateMemories(memoriesGiven);
        PlayerMemoriesBox.UpdateMemories(memoriesPlayer);
    }
Example #5
0
    private void OnEnable()
    {
        player.DisableControls();
        player.EnableKey("interact");

        goals.SetMyraGoal("bring_flower");

        dialogue.ResetDialogue();
        dialogue.Play();

        int j = 0;
        for (int i = 0; i < items.Length; i++)
        {
            if (inventory.FindItemInInventory(items[i].nameItem))
            {
                switch (items[i].nameItem)
                {
                    case "flower_carnation":
                        btns[j].onClick.AddListener(GiveCarnation);
                        break;
                    case "flower_gardenia":
                        btns[j].onClick.AddListener(GiveGardenia);
                        break;
                    case "flower_winterberry":
                        btns[j].onClick.AddListener(GiveWinterberry);
                        break;
                    default:
                        Debug.Log("invalid flower");
                        break;
                }
                
                btns[j].gameObject.SetActive(true);
                StartCoroutine(UpdateButtonText(btns[j], LocalizedText.GetTextDeterminatedKey(items[i].nameItem)));
                j++;
            }
        }
        anim.SetBool("OptionsActive", true);
    }
Example #6
0
    private void DialoguePhases()
    {
        timer  += Time.deltaTime;
        seconds = (int)(timer % 60);
        float pos = player.gameObject.transform.position.z;

        switch (phase)
        {
        case "start":
            if (seconds >= 4)
            {
                anim.SetTrigger("StartDialogue");
                phase = "second";
            }
            break;

        case "second":
            if (seconds >= 12 && Mathf.Abs(pos) > 70)
            {
                anim.SetTrigger("StartDialogue");
                phase = "third";
            }
            break;

        case "third":
            if (seconds >= 20 && Mathf.Abs(pos) > 250)
            {
                anim.SetTrigger("StartDialogue");
                phase = "fourth";
            }
            break;

        case "fourth":
            if (seconds >= 28 && Mathf.Abs(pos) > 400)
            {
                text.alignment = TextAlignmentOptions.MidlineLeft;
                anim.SetTrigger("DarkYmir");
                phase = "fifth";
            }
            break;

        case "fifth":
            if (dialogue.GetEndLine())
            {
                if (player.GetInteractTrigger())
                {
                    anim.SetTrigger("NormalYmir");
                    phase = "sixth";
                }
            }
            break;

        case "sixth":
            if (player.GetInteractTrigger())
            {
                if (!dialogue.GetDialogueEnded())
                {
                    if (dialogue.GetEndLine())
                    {
                        dialogue.Play();
                    }
                }
                else
                {
                    buttonEyes.interactable = true;
                    textButton.SetActive(true);
                    phase = "finish";
                }
            }
            break;
        }
    }