private void OnTriggerEnter(Collider other) { PlayerShoot ps = other.GetComponent <PlayerShoot>(); if (ps != null) { ps.AddAmmo(_countAmmoInTheBox); gameObject.SetActive(false); } }
protected override void TriggerEffect(Collider2D collider) { PlayerShoot pShoot = collider.GetComponent <PlayerShoot>(); if (pShoot == null) { return; } pShoot.AddAmmo(AmmoCount); pickedUp.Invoke(this); }