Example #1
0
    public void OnCollisionEnter(Collision collision)
    {
        spawnProjectile = collision.gameObject.GetComponentInChildren <SpawnProjectile>();
        if (spawnProjectile != null)
        {
            spawnProjectile.SetBullets(5);
        }

        spawnProjectile.SetAmmoIconFalse();

        spawnProjectile = null;
    }
Example #2
0
    private void OnTriggerEnter(Collider other)
    {
        FindObjectOfType <AudioManager>().Play("Recharge");
        spawnProjectile = other.gameObject.GetComponentInChildren <SpawnProjectile>();

        if (spawnProjectile != null)
        {
            spawnProjectile.SetBullets(5);
        }

        spawnProjectile.SetAmmoIconFalse();
        spawnProjectile = null;
    }