void Update() { if (Input.GetButtonDown("Fire1")) { StartCoroutine(cameraShake.Shake(.1f, .05f)); } }
public void Shoot() { playerController.mana -= damage; CancelInvoke("AddMana"); playerController.invokedAddingMana = false; // create bullet float bulletForce = force; GameObject bulletClone = Instantiate(bulletPrefab, firingPoint.position, firingPoint.rotation); Rigidbody2D bulletRB = bulletClone.GetComponent <Rigidbody2D>(); bulletRB.AddForce(firingPoint.up * bulletForce, ForceMode2D.Impulse); StartCoroutine(cameraShakeScript.Shake(0.1f, 0.05f)); }