Ejemplo n.º 1
0
    public IEnumerator AimWeapon()
    {
        currentGun.transform.rotation = GunFunctions.CalcPlayerToMouseAngle(transform.position);
        yield return(new WaitForSeconds(0.5f));

        IdleWeapon();
    }
Ejemplo n.º 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");
    }