Esempio n. 1
0
 public override void TakeDamage(string killType)
 {
     if (killType.Equals("fire"))
     {
         hitPoints = 0;
         ass.Stop();
         leftWing.Stop();
         rightWing.Stop();
         col.enabled = false;
         GetComponent <BoxCollider2D>().enabled = false;
         if (isFacingRight)
         {
             rb.velocity = new Vector2(1f, 10f) * Xvel;
         }
         else
         {
             rb.velocity = new Vector2(-1f, 10f) * Xvel;
         }
         transform.localScale = new Vector2(transform.localScale.x, -transform.localScale.y);
         destroyOnExit        = true;
         rb.gravityScale      = 7;
     }
     else if (killType.Equals("stomp"))
     {
         Goomba g = Instantiate(Goomba, transform.position, Quaternion.identity).GetComponent <Goomba>();
         g.StartCoroutine(g.StartFromPara(isFacingRight));
         Destroy(gameObject);
     }
 }