Exemplo n.º 1
0
    BulletDeluxe create_bullet(ShotPatternData shot_data, BulletData bullet_data, Vector3 position, float angle_grad)
    {
        BulletDeluxe bullet = pool.getNewBullet().GetComponent <BulletDeluxe>();

        bullet.activate();

        bullet.setData(bullet_data, player);

        if (!bullet_data.faceVelocity)
        {
            bullet.GetComponentInChildren <ComponentFixRotation>().enabled = true;
        }

        bullet.setRotation(angle_grad);
        bullet.setPosition(position + bullet.transform.up * shot_data.radialOffset);
        bullet.setSpeed(shot_data.bulletSpeed);
        bullet.setAngularVelocity(shot_data.bulletAngularVelocity);

        event_manager.addBullet(bullet);

        return(bullet);
    }