Esempio n. 1
0
 void Update()
 {
     if (Input.GetButtonDown("Fire1"))
     {
         StartCoroutine(cameraShake.Shake(.1f, .05f));
     }
 }
Esempio n. 2
0
    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));
    }