private void Update()
    {
        if (bulletCount <= 0)
        {
            wPUP.DisablePowerUp(powerUpNum);
        }


        if (XCI.GetButtonDown(XboxButton.A, controller) && canShoot)
        {
            canShoot = false;
            StartCoroutine(Shoot());
        }
    }
Beispiel #2
0
    private void Update()
    {
        if (bulletCount <= 0)
        {
            wPUP.DisablePowerUp(powerUpNum);
        }


        if (XCI.GetButtonDown(XboxButton.A, controller) && Time.time >= nextTimeToFire)
        {
            nextTimeToFire = Time.time + 1f / fireRate;
            Shoot();
        }
    }
Beispiel #3
0
    void Shockwave()
    {
        Collider[] colliders = Physics.OverlapSphere(transform.position, radius);
        foreach (Collider hit in colliders)
        {
            Rigidbody hitRB = hit.GetComponent <Rigidbody>();
            if (hitRB != null && !hit.GetComponent <WNotAffected>() && hitRB != rb)
            {
                hitRB.AddExplosionForce(impactForce, transform.position, radius, upwardsThrust, ForceMode.Impulse);
            }
        }

        Instantiate(explosion, transform.position, transform.rotation);
        wPUP.DisablePowerUp(powerUpNum);
    }