hello
I have 2 scripts one is called Characterdamage and the other one is called zombiewinkelchecker
what i wanna do is when an enemy dies in characterdamage it will be removed from the list in zombiewinkelchecker.
But i dont know how to do that
Hope someone can help
Zombiewinkelchecker.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class zombiewinkelchecker : MonoBehaviour {
public List<GameObject> enemies = new List<GameObject>();
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
//print(enemies.Count);
//if(enemies.Count == 0)
//{
// Debug.Log("geen zombies over");
//
// }
if (Input.GetKey(KeyCode.M))
{
//enemies.RemoveAt;
}
}
}
charachterdamge.cs
if (hitPoints <= 0.0f){
SendMessage("Die");
Debug.Log("dood");
//here it needs to delete that enemy from the list the list called enemies in zombiewinkelchecker
}