private void RescueFarmAnimals(GameObject animal) { if (animal.GetComponent <FarmAnimal>()) { sound.clip = snatchAnimalSound; sound.Play(); GameObject parent = animal.transform.parent.gameObject; Destroy(parent); npc.RemovePositionFromGrid(parent); generator.SetAnimalCount(); animalCountText.text = generator.GetAnimalCount().ToString(); Debug.Log(generator.GetAnimalCount()); Debug.Log(FarmAnimal.animalCount); Debug.Log(""); } }