public void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { CharacterStats PC = other.gameObject.GetComponent <CharacterStats>(); switch (RecoverWhat) { case RecoverType.health: PC.AdjustHP(Amount); Destroy(gameObject); break; case RecoverType.mana: PC.AdjustMana(Amount); Destroy(gameObject); break; } } }