Ejemplo n.º 1
0
    public void InstantiateBulletBundle()
    {
        GameObject bulletBundle = Instantiate(bulletBundlePrefab, rifleMuzzleGameObject.transform.position, rifleMuzzleGameObject.transform.rotation);

        bulletBundle.GetComponent <BulletBundle> ().SetInfo(
            rifleInfo.GetRifleProperties().rifleBundleBulletNumber
            , rifleInfo.GetRifleProperties().rifleFixedAngleBetBullets
            , rifleInfo.GetRifleProperties().rifleBulletRange
            , rifleInfo.GetRifleProperties().rifleFixedBulletTime
            , rifleInfo.GetRifleProperties().rifleBulletDamage);
    }
    public void FireForce()
    {
        Vector3 rotationVector = rifleGameObject.transform.forward * -1;
        Vector3 forceVector    = rotationVector * rifleInfo.GetRifleProperties().rifleFixedKnockBackForce;

        playerRigidbody.velocity = forceVector;
    }