예제 #1
0
 public void TakeDamage(float damage)
 {
     currentHealth -= damage;
     if (currentHealth <= 0)
     {
         Destroy(gameObject);
         Level_Loader load = loader.GetComponent <Level_Loader>();
         load.LoadNextLevel(0, 3);
     }
 }
예제 #2
0
    void Died()
    {
        animator.SetBool("isDead", true);

        GetComponent <BoxCollider2D>().enabled    = false;
        GetComponent <CircleCollider2D>().enabled = false;
        GetComponent <Rigidbody2D>().gravityScale = 0f;

        Level_Loader load = loader.GetComponent <Level_Loader>();

        load.LoadNextLevel(0, 3);

        this.enabled = false;
    }