示例#1
0
文件: shootShake.cs 项目: HelZen/f-ck
 void Update()
 {
     if (Input.GetButtonDown("Fire1"))
     {
         StartCoroutine(cameraShake.Shake(.1f, .05f));
     }
 }
示例#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));
    }