Esempio n. 1
0
    /// <summary>
    /// Funcion que se llama cuando el evento PlayerController.OnActivate se dispara
    /// </summary>
    public override void OnInteract()
    {
        playerInBounds = detectCollider.bounds.Contains(player.transform.position);

        if (playerInBounds)
        {
            if (bDoorNeedsKey)
            {
                dialogueTrigger.Dialogue();

                for (int i = 0; i < player.playerInventory.itemsInInventory.Count; i++)
                {
                    if (player.playerInventory.itemsInInventory[i].itemName == doorKeyName)
                    {
                        player.playerInventory.DeleteFromInv(player.playerInventory.itemsInInventory[i]);
                        GameManager.Instance.LoadNextLevel(levelToLoadName);
                    }
                    else
                    {
                        print("Player needs the " + doorKeyName + " key.");
                    }
                }
            }
            else
            {
                GameManager.Instance.LoadNextLevel(levelToLoadName);
                print("Door doesn't need a key, opening...");
            }
        }
    }
Esempio n. 2
0
    /// <summary>
    /// Funcion que se llama cuando el evento PlayerController.OnActivate se dispara
    /// </summary>
    public override void OnInteract()
    {
        playerInBounds = detectCollider.bounds.Contains(player.transform.position);

        if (playerInBounds)
        {
            dialogueTrigger.Dialogue();
            DisablePopUp();
        }
    }
Esempio n. 3
0
 public void Start()
 {
     if (SceneManager.GetActiveScene().buildIndex == 3)
     {
         if (died)
         {
             bossDeathDialogue.Dialogue();
         }
         else
         {
             bossDialogue.Dialogue();
         }
     }
 }