예제 #1
0
    //Special attack
    public override IEnumerator Special()
    {
        for (int i = 0; i < specialBulletAmount; i++)
        {
            Quaternion rot = GunFunctions.calcSpreadShot(this.transform.position, -minSpread, maxSpread);
            GameObject go  = Instantiate(specialBulletPrefab, shootPos.transform.position, rot);
            go.GetComponent <IBullet>().SetupStats(specialBulletSpeed, specialBulletDmg, new Vector2(1, 0));
            //Feedback
            GunFunctions.KnockBack(player.GetComponent <Rigidbody2D>(), (rot * transform.right * -1), shotForce);
            StartCoroutine(cam.GetComponent <CameraScript>().CameraShake(shotCameraShakeForce, shotCameraDuration + 0.2f));

            //Wouter HeavyGunShot
            FMODUnity.RuntimeManager.PlayOneShot("event:/Weapon/GrenadeLauncherShot");
        }
        yield return(null);
    }
예제 #2
0
    //Normal attack
    public override void Shoot()
    {
        if (!bulletPrefab)
        {
            return;
        }

        Quaternion rot = GunFunctions.CalcPlayerToMouseAngle(this.transform.position);
        GameObject go  = Instantiate(bulletPrefab, shootPos.transform.position, rot);

        go.GetComponent <IBullet>().SetupStats(bulletSpeed, bulletDmg, new Vector2(1, 0));
        //Feedback
        GunFunctions.KnockBack(player.GetComponent <Rigidbody2D>(), (rot * transform.right * -1), shotForce);
        StartCoroutine(cam.GetComponent <CameraScript>().CameraShake(shotCameraShakeForce, shotCameraDuration));

        //Wouter PlasmaGunShot
        FMODUnity.RuntimeManager.PlayOneShot("event:/Weapon/GrenadeLauncherShot");
    }