void OnTriggerEnter2D(Collider2D coll) { Debug.Log("Some object was reached"); // Food? if (coll.name.StartsWith("FoodPrefab")) { Debug.Log("food was reached, eating..."); foodWasEaten = true; foodController.DestroyFood(coll); } else { gameManager.ShowGameOverPanel(); } }
void ClearWorld() { creatureController.UpdateCreatures(); foodController.DestroyFood(); }