private void OnTriggerEnter2D(Collider2D collision) { if (collision.transform.CompareTag("Player")) { DataPlayerChange manaHealthBar = player.GetComponent <DataPlayerChange>(); playerAnimator.SetBool("Spell", true); manaHealthBar.UseMana(50); manaHealthBar.AddHealth(30); if (manaHealthBar.GetHealth() > 100) { manaHealthBar.ResetHealth(); } playerAnimator.SetBool("Spell", false); } }
public void HealRegenTouch(DataPlayerChange manaBar) { if (counterSpell == 0) { if ((manaBar.GetMana() > 49) && (manaBar.GetHealth() < 100)) { counterSpell = 1; Instantiate(healRegen, spawnZone.position, spawnZone.rotation); StartCoroutine(Time()); } else { return; } } else { return; } }