addScreenShake() public method

public addScreenShake ( float shakeAmount ) : void
shakeAmount float
return void
Exemplo n.º 1
0
    void TakeDamage()
    {
        Debug.Log("taking damage");
        meow.Play();

        currentLives--;
        if (currentLives > 0)           //test1
        {
            animator.SetTrigger("DamageTaken");
        }
        Debug.Log(currentLives);
        UpdateUI();
        if (currentLives <= 0)
        {
            this.GetComponent <Collider2D> ().enabled   = false;
            this.GetComponent <FollowObject> ().enabled = false;
            animator.SetTrigger("Dead"); //test1
            uiScript.EndGame();
            Destroy(gameObject, 2);      //test1
        }
        if (mainCam)
        {
            mainCam.addScreenShake(10);
        }
        remainingInvincibiltiyTime = invincibilityTime;

        //test

        Debug.Log(Physics2D.GetIgnoreCollision(collided, this.GetComponent <Collider2D>()));
    }