Example #1
0
    public override void Play(ShootHelper user)
    {
        AudioHandler audioHandler = user.shooter.GetComponent <AudioHandler>();

        audioHandler.PlaySound("Shield");
        Ray        shieldDirection = user.GetOffsetRay();
        ShotObject shotBullet      = Instantiate(m_shieldPrefab, shieldDirection.origin + user.m_bulletSpawnPoint.rotation * m_shieldPositionOffset, Quaternion.LookRotation(shieldDirection.direction));

        shotBullet.shooter    = user.shooter;
        shotBullet.m_lifeTime = m_shieldLifeTime;
    }
Example #2
0
    public override void Play(ShootHelper user)
    {
        AudioHandler audioHandler = user.shooter.GetComponent <AudioHandler>();

        audioHandler.PlaySound("Shoot");
        Ray          bulletDirection = user.GetOffsetRay();
        NormalBullet shotBullet      = Instantiate(m_bulletPrefab, bulletDirection.origin, Quaternion.LookRotation(bulletDirection.direction));

        shotBullet.GetComponent <Rigidbody>().velocity = bulletDirection.direction * m_bulletSpeed;
        shotBullet.shooter = user.shooter;
    }