private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player") && !collision.isTrigger) { context.Raise(); playerInRange = true; } }
public void Knock(float knockTime, float damage) { currentHealth.RuntimeValue -= damage; PlayerHealthSignal.Raise(); if (currentHealth.RuntimeValue > 0) { StartCoroutine(KnockCo(knockTime)); } else { this.gameObject.SetActive(false); } }
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); }
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"); } }