using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Barrier : MonoBehaviour
{
[SerializeField] GameObject squareParent;
[SerializeField] GameObject square;
[SerializeField] GameObject square1;
public static int Enemykilled = 0;
public int Killrequired;
public static int Enemykilled1 = 1;
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Enemykilled == Killrequired)
{
square.SetActive(false);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Begin : MonoBehaviour
{
[SerializeField] GameObject HELParent;
[SerializeField] GameObject ME;
[SerializeField] GameObject PLZ;
public static int Hi = 0;
public int Killrequired;
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Hi == Killrequired)
{
HELParent.SetActive(false);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy1 : MonoBehaviour
{
public int health = 100;
public Rigidbody rb;
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void TakeDamage(int damage)
{
health -= damage;
if (health <= 0)
{
Die();
}
}
void Die()
{
Begin.Hi = 1;
Destroy(gameObject);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
public int health = 7;
public Rigidbody rb;
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void TakeDamage(int damage)
{
health -= damage;
if (health <= 0)
{
Die();
}
}
void Die()
{
Destroy(gameObject);
Barrier.Enemykilled++;
}
}