Esempio n. 1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Enemy_Alien enemy = collision.GetComponent <Enemy_Alien>();

        if (enemy != null)
        {
            enemy.Damage(1);
        }
        Enemy_Bullet ebullet = collision.GetComponent <Enemy_Bullet>();

        if (ebullet != null)
        {
            ebullet.Reflect(transform.up);
        }
        Enemy_BallLightning eball = collision.GetComponent <Enemy_BallLightning>();

        if (eball != null)
        {
            eball.Dissipate();
        }
        Enemy_Mine emine = collision.GetComponent <Enemy_Mine>();

        if (emine != null)
        {
            emine.Detonate();
        }
        Rover_AI rover = collision.GetComponent <Rover_AI>();

        if (rover != null)
        {
            rover.Knockback(transform.up);
        }
    }
Esempio n. 2
0
 // Start is called before the first frame update
 void Start()
 {
     rover          = FindObjectOfType <Rover_AI>();
     curhealth      = maxhealth;
     healthbarWidth = healthBar.rect.width;
     aim            = Vector3.up;
 }
Esempio n. 3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Rover_AI rover = collision.GetComponent <Rover_AI>();

        if (rover != null)
        {
            rover.Damage(damage);
        }
    }
Esempio n. 4
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Rover_AI rover = collision.GetComponent <Rover_AI>();

        if (rover != null)
        {
            StartCoroutine("DetonateDelay", .5f);
        }
    }
Esempio n. 5
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Rover_AI rover = collision.GetComponent <Rover_AI>();

        if (rover != null)
        {
            var spawnedbullet = GameObject.Instantiate(bounceOffBullet, transform.position, transform.rotation, null);
            GameObject.Destroy(gameObject);
        }
        Alien_Actions alien = collision.GetComponent <Alien_Actions>();

        if (alien != null)
        {
            alien.Damage(damage);
            GameObject.Destroy(gameObject);
        }
    }
Esempio n. 6
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Rover_AI rover = collision.GetComponent <Rover_AI>();

        if (rover != null)
        {
            var spawnedbullet = GameObject.Instantiate(bounceOffBullet, transform.position, transform.rotation, null);
            GameObject.Destroy(gameObject);
        }
        Enemy_Alien enemy = collision.GetComponent <Enemy_Alien>();

        if (enemy != null)
        {
            enemy.Damage(damage);
            GameObject.Destroy(gameObject);
        }
        Enemy_Mine emine = collision.GetComponent <Enemy_Mine>();

        if (emine != null)
        {
            emine.Detonate();
            GameObject.Destroy(gameObject);
        }
    }
Esempio n. 7
0
 // Start is called before the first frame update
 void Start()
 {
     rover = FindObjectOfType <Rover_AI>();
     aim   = Vector3.up;
 }
Esempio n. 8
0
 // Start is called before the first frame update
 void Start()
 {
     rover = FindObjectOfType <Rover_AI>();
     aim   = Vector3.up * bulletSpeed;
 }