Inheritance: MonoBehaviour
Esempio n. 1
0
 public void Stun(GameObject loser)
 {
     this.stunTime = 0f;
     this.standStill = loser.GetComponent<EnemyFullAI>();
     this.standStill.coward.isCoward = true;
     this.isStunned = true;
 }
Esempio n. 2
0
    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);
            }
        }
    }
Esempio n. 3
0
 public void Stun(GameObject loser)
 {
     this.stunTime   = 0f;
     this.standStill = loser.GetComponent <EnemyFullAI>();
     this.standStill.coward.isCoward = true;
     this.isStunned = true;
 }