示例#1
0
    private void OnTriggerEnter(Collider other)
    {
        PlayerShoot ps = other.GetComponent <PlayerShoot>();

        if (ps != null)
        {
            ps.AddAmmo(_countAmmoInTheBox);
            gameObject.SetActive(false);
        }
    }
示例#2
0
    protected override void TriggerEffect(Collider2D collider)
    {
        PlayerShoot pShoot = collider.GetComponent <PlayerShoot>();

        if (pShoot == null)
        {
            return;
        }

        pShoot.AddAmmo(AmmoCount);
        pickedUp.Invoke(this);
    }