public void Stun(GameObject loser) { this.stunTime = 0f; this.standStill = loser.GetComponent<EnemyFullAI>(); this.standStill.coward.isCoward = true; this.isStunned = true; }
void OnOwie(Collider2D collider) { //this.death.Play (); if (!collider.isTrigger && collider.transform != this.spawner && this.tag != collider.tag) { Health target = collider.GetComponent <Health> (); if (target != null) { target.ChangeHealth(-damage); collider.transform.position += (collider.transform.position - this.transform.position).normalized * this.knockback; //stun the reciepient for a short amount of time GameObject enemy = collider.gameObject; if (enemy.tag != "Player") { EnemyFullAI script = enemy.GetComponent <EnemyFullAI>(); script.Stun(enemy); } Sounds.instance.Hit(); } if (this.destroyOnTouch) { //this.hit.Play (); //Destroy (this.gameObject); TrailRenderer trail = this.GetComponent <TrailRenderer>(); if (trail != null) { trail.enabled = false; } this.GetComponent <Renderer>().enabled = false; this.transform.position = Vector3.one * 9999999f; //Destroy(gameObject, this.hit.clip.length); } } }
public void Stun(GameObject loser) { this.stunTime = 0f; this.standStill = loser.GetComponent <EnemyFullAI>(); this.standStill.coward.isCoward = true; this.isStunned = true; }