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); } }
// Start is called before the first frame update void Start() { rover = FindObjectOfType <Rover_AI>(); curhealth = maxhealth; healthbarWidth = healthBar.rect.width; aim = Vector3.up; }
private void OnTriggerEnter2D(Collider2D collision) { Rover_AI rover = collision.GetComponent <Rover_AI>(); if (rover != null) { rover.Damage(damage); } }
private void OnTriggerEnter2D(Collider2D collision) { Rover_AI rover = collision.GetComponent <Rover_AI>(); if (rover != null) { StartCoroutine("DetonateDelay", .5f); } }
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); } }
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); } }
// Start is called before the first frame update void Start() { rover = FindObjectOfType <Rover_AI>(); aim = Vector3.up; }
// Start is called before the first frame update void Start() { rover = FindObjectOfType <Rover_AI>(); aim = Vector3.up * bulletSpeed; }