Код: Выделить всё
private void Awake()
{
plateVisualGameObjectList = new List();
}
private void Start()
{
platesCounter.OnPlateSpawned += PlatesCounter_OnPlateSpawned;
platesCounter.OnPlateRemoved += PlatesCounter_OnPlateRemoved;
}
private void PlatesCounter_OnPlateRemoved(object sender, System.EventArgs e)
{
GameObject plateGameObject = plateVisualGameObjectList[plateVisualGameObjectList.Count - 1];
plateVisualGameObjectList.Remove(plateGameObject);
Destroy(plateGameObject);
}
Подробнее здесь: https://stackoverflow.com/questions/785 ... stroying-a