Example #1
0
    void Shoot()
    {
        SoundManager.Play(audioSrc, SoundManager.Clip.PLAYER_SHOOT);

        Vector3 pos = transform.position + transform.up * BULLET_SPAWN_DIST;

        ProjectileScript proj = Instantiate(bulletPrefab, pos, transform.rotation).GetComponent <ProjectileScript>();

        proj.Construct(transform.up * BULLET_SPEED, BULLET_DAMAGE, GetBulletType(), 0);
    }
Example #2
0
    void Shoot()
    {
        for (float i = 0; i < BULLET_COUNT[rageIndex]; ++i)
        {
            SoundManager.Play(audioSrc, SoundManager.Clip.BOSS_SHOOT);
            float angle = ((MathSET.Map(i, 0, BULLET_COUNT[rageIndex], 0f, 360f) + angleOffset) % 360f) * Mathf.Deg2Rad;

            Vector3 vel = new Vector3(BULLET_SPEEDS[rageIndex] * Mathf.Cos(angle), BULLET_SPEEDS[rageIndex] * Mathf.Sin(angle), 0f);

            ProjectileScript proj = Instantiate(bulletPrefab, transform.position, Quaternion.Euler(0f, 0f, angle * Mathf.Rad2Deg)).GetComponent <ProjectileScript>();
            proj.Construct(vel, BULLET_DAMAGE, "Bullet_pi", 255);
        }
    }