Пример #1
0
    public void DestroyFood(GameObject other)
    {
        AudioSource pickUp = GetComponent <AudioSource>();

        pickUp.Play();

        other.SetActive(false);
        ui.foodCollected();
    }
Пример #2
0
    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);
    }