using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Shooting : MonoBehaviour
{
public float enemy_hp_1 = 100f;
public float enemy_hp_2 = 100f;
public float enemy_hp_3 = 100f;
public float enemy_hp_4 = 100f;
public float enemy_hp_5 = 100f;
public float enemy_hp_6 = 100f;
public float enemy_hp_7 = 100f;
public float enemy_hp_8 = 100f;
public float enemy_hp_9 = 100f;
public float enemy_hp_10 = 100f;
public float enemy_hp_11 = 100f;
public float Kills = 0f;
void Start()
{
}
void Update()
{
}
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.name == "enemy1")
{
enemy_hp_1 = enemy_hp_1 - 20f;
Debug.Log(enemy_hp_1);
if (enemy_hp_1 <= 0)
{
Destroy(collision.gameObject);
Debug.Log("Enemy distroyed , Fantasctic");
Kills = Kills + 1;
Debug.Log("+ 1 kill , Overall Kills = " + Kills);
}
Destroy(this.gameObject);
}
if (collision.name == "enemy2")
{
enemy_hp_2 = enemy_hp_2 - 20f;
Debug.Log(enemy_hp_2);
if (enemy_hp_2 <= 0)
{
Destroy(collision.gameObject);
Debug.Log("Enemy distroyed , Fantasctic");
Kills = Kills + 1;
Debug.Log("+ 1 kill , Overall Kills = " + Kills);
}
Destroy(this.gameObject);
}
if (collision.name == "enemy3")
{
enemy_hp_3 = enemy_hp_3 - 20f;
Debug.Log(enemy_hp_3);
if (enemy_hp_3 <= 0)
{
Destroy(collision.gameObject);
Debug.Log("Enemy distroyed , Fantasctic");
Kills = Kills + 1;
Debug.Log("+ 1 kill , Overall Kills = " + Kills);
}
Destroy(this.gameObject);
}
if (collision.name == "enemy4")
{
enemy_hp_4 = enemy_hp_4 - 20f;
Debug.Log(enemy_hp_4);
if (enemy_hp_4 <= 0)
{
Destroy(collision.gameObject);
Debug.Log("Enemy distroyed , Fantasctic");
Kills = Kills + 1;
Debug.Log("+ 1 kill , Overall Kills = " + Kills);
}
Destroy(this.gameObject);
}
if (collision.name == "enemy5")
{
enemy_hp_5 = enemy_hp_5 - 20f;
Debug.Log(enemy_hp_5);
if (enemy_hp_5 <= 0)
{
Destroy(collision.gameObject);
Debug.Log("Enemy distroyed , Fantasctic");
Kills = Kills + 1;
Debug.Log("+ 1 kill , Overall Kills = " + Kills);
}
Destroy(this.gameObject);
}
if (collision.name == "enemy6")
{
enemy_hp_6 = enemy_hp_6 - 20f;
Debug.Log(enemy_hp_6);
if (enemy_hp_6 <= 0)
{
Destroy(collision.gameObject);
Debug.Log("Enemy distroyed , Fantasctic");
Kills = Kills + 1;
Debug.Log("+ 1 kill , Overall Kills = " + Kills);
}
Destroy(this.gameObject);
}
if (collision.name == "enemy7")
{
enemy_hp_7 = enemy_hp_7 - 20f;
Debug.Log(enemy_hp_7);
if (enemy_hp_7 <= 0)
{
Destroy(collision.gameObject);
Debug.Log("Enemy distroyed , Fantasctic");
Kills = Kills + 1;
Debug.Log("+ 1 kill , Overall Kills = " + Kills);
}
Destroy(this.gameObject);
}
if (collision.name == "enemy8")
{
enemy_hp_8 = enemy_hp_8 - 20f;
Debug.Log(enemy_hp_8);
if (enemy_hp_8 <= 0)
{
Destroy(collision.gameObject);
Debug.Log("Enemy distroyed , Fantasctic");
Kills = Kills + 1;
Debug.Log("+ 1 kill , Overall Kills = " + Kills);
}
Destroy(this.gameObject);
}
if (collision.name == "enemy9")
{
enemy_hp_9 = enemy_hp_9 - 20f;
Debug.Log(enemy_hp_9);
if (enemy_hp_9 <= 0)
{
Destroy(collision.gameObject);
Debug.Log("Enemy distroyed , Fantasctic");
Kills = Kills + 1;
Debug.Log("+ 1 kill , Overall Kills = " + Kills);
}
Destroy(this.gameObject);
}
if (collision.name == "enemy10")
{
enemy_hp_10 = enemy_hp_10 - 20f;
Debug.Log(enemy_hp_10);
if (enemy_hp_10 <= 0)
{
Destroy(collision.gameObject);
Debug.Log("Enemy distroyed , Fantasctic");
Kills = Kills + 1;
Debug.Log("+ 1 kill , Overall Kills = " + Kills);
}
Destroy(this.gameObject);
}
if (collision.name == "enemy11")
{
enemy_hp_11 = enemy_hp_11 - 20f;
Debug.Log(enemy_hp_11);
if (enemy_hp_11 <= 0)
{
Destroy(collision.gameObject);
Debug.Log("Enemy distroyed , Fantasctic");
Kills = Kills + 1;
Debug.Log("+ 1 kill , Overall Kills = " + Kills);
}
Destroy(this.gameObject);
}
if (collision.name == "Boundry")
{
Destroy(this.gameObject);
}
}
}