protected override void onRabbitHit(HeroRabbit rabbit) { Animator animatorR = rabbit.GetComponent <Animator> (); animatorR.SetTrigger("die"); Destroy(this.gameObject); }
private void OnCollisionEnter2D(Collision2D collision) { HeroRabbit rabbit = collision.collider.GetComponent <HeroRabbit>(); if (rabbit != null) { ContactPoint2D point = collision.contacts[0]; Debug.Log(point.normal); Debug.DrawLine(point.point, point.point + point.normal, Color.red, 10); if (Mathf.Abs(point.point.y) >= 0.5f) { Animator animator = this.GetComponent <Animator>(); animator.SetTrigger("death"); die = true; } else if (!die) { Animator animatorOrc = GetComponent <Animator>(); animatorOrc.SetTrigger("attack"); Animator animator = rabbit.GetComponent <Animator>(); animator.SetTrigger("death"); rabbit.isDead = true; } } }
protected override void OnRabitHit(HeroRabbit rabbit) { Animator animator = rabbit.GetComponent <Animator>(); animator.SetTrigger("death"); rabbit.isDead = true; //this.CollectedHide(); Destroy(this.gameObject); }
protected override void OnRabitHit(HeroRabbit rabit) { if (rabit.isBigg()) { rabit.setBig(false); Vector3 currSize = rabit.transform.localScale; rabit.transform.localScale = new Vector3(currSize.x / 1.5f, currSize.y / 1.5f, 0); } else { rabit.GetComponent <Animator>().SetBool("isDie", true); } this.CollectedHide(); }
IEnumerator whileDying(float sec, HeroRabbit rabbit, bool hasMoreLives) { Animator animator = rabbit.GetComponent <Animator>(); animator.SetBool("dead", true); yield return(new WaitForSeconds(sec)); rabbit.transform.position = this.startingPosition; animator.SetBool("dead", false); if (!hasMoreLives) { rabbit.setInActive(); LoseLevelPopUp.current.Open(); } }
protected override void onRabbitHit(HeroRabbit rabbit) { this.CollectedHide(); if (rabbit != null) { if (rabbit.isBigger) { rabbit.resize(1); } else { Animator animator = rabbit.GetComponent <Animator> (); animator.SetTrigger("die"); } } }
protected override void OnRabitHit(HeroRabbit rabbit) { if (rabbit.hasMushroom) { rabbit.transform.localScale = new Vector3(1, 1, 1); rabbit.hasMushroom = false; } else { // DIE MF DIE (c) Dope Animator animator = rabbit.GetComponent <Animator>(); animator.SetTrigger("death"); rabbit.isDead = true; } this.CollectedHide(); }
protected virtual void OnRabitHit(HeroRabbit rabit) { hideAnimation = true; if (!rabit.isBigRabbit && rabit != null) { LevelController.current.onRabitDeath(rabit); CollectedHide(); } else if (rabit.isBigRabbit && rabit != null) { rabit.isBigRabbit = false; CollectedHide(); rabit.canHit = false; rabit.GetComponent <SpriteRenderer>().sprite = Resources.Load("pain_000", typeof(Sprite)) as Sprite; } }
IEnumerator dsbl(HeroRabbit rabit) { yield return(new WaitForSeconds(0.2f)); rabit.GetComponent <HeroRabbit>().enabled = false; }