private void OnTriggerEnter2D(Collider2D other) { EnemyLife life = other.gameObject.GetComponent <EnemyLife>(); if (life != null) { GameObject.Destroy(gameObject); life.Damage(EnemyLife.RED, damage); } }
void Update() { currentDamage += damageGainPerTurn * Time.deltaTime; target.Damage(currentDamage * Time.deltaTime); }