public void DestroyFood(GameObject other) { AudioSource pickUp = GetComponent <AudioSource>(); pickUp.Play(); other.SetActive(false); ui.foodCollected(); }
public void collectingFoodIncreasesPoopAmount() { GameObject uiContainer = new GameObject(); UIscript ui = uiContainer.AddComponent <UIscript>(); ui.poopFill = uiContainer.AddComponent <Image>(); ui.pooAmount = 0; ui.poopFill.enabled = false; ui.foodCollected(); Assert.IsTrue(ui.pooAmount > 0 && ui.poopFill.enabled); }