Exemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player") && !collision.isTrigger)
     {
         context.Raise();
         playerInRange = true;
     }
 }
Exemplo n.º 2
0
 public void Knock(float knockTime, float damage)
 {
     currentHealth.RuntimeValue -= damage;
     PlayerHealthSignal.Raise();
     if (currentHealth.RuntimeValue > 0)
     {
         StartCoroutine(KnockCo(knockTime));
     }
     else
     {
         this.gameObject.SetActive(false);
     }
 }
Exemplo n.º 3
0
    public void OpenChest()
    {
        //Dialog Window On
        dialogBox.SetActive(true);

        //Dialog Text = Contents Text
        dialogText.text = contents.itemDescription;

        //Add Contents To The Inventory
        playerInventory.AddItem(contents);
        playerInventory.currentItem = contents;

        //Raise The Signal To The Player To Animate
        raiseItem.Raise();

        //Raise The Context Clue
        context.Raise();

        //Set The Chest To Opened
        isOpen = true;
        anim.SetBool("Opened", true);
    }
Exemplo n.º 4
0
 public void Knock(float knockTime, float damage)
 {
     if (IsResistingDMG)
     {
         damage *= DamageRes;
     }
     currentHealth.RuntimeValue -= damage;
     PlayerHealthSignal.Raise();
     if (currentHealth.RuntimeValue > 0)
     {
         StartCoroutine(KnockCo(knockTime));
     }
     else
     {
         this.gameObject.SetActive(false);
         SceneManager.LoadScene("GameOver");
     }
 }