Ejemplo n.º 1
0
 public void Drink()
 {
     player = GameObject.FindGameObjectWithTag("Player").GetComponent("Character") as Character;
     isEating = true;
     player.FeedAnimal((water.GetComponent("WaterDrink") as WaterDrink));
     StartCoroutine(DelayForFeeding(water));
 }
Ejemplo n.º 2
0
        public void EatChicken()
        {
            player = GameObject.FindGameObjectWithTag("Player").GetComponent("Character") as Character;
            if (!isEating)
            {
                PurchaseFood(chicken);

                if (isAble(chickenCount, 1))
                {
                    isEating = true;
                    MeshRenderer skin = chicken.GetComponent("MeshRenderer") as MeshRenderer;
                    skin.enabled = true;
                    player.FeedAnimal((chicken.GetComponent("ChickenFood") as ChickenFood));
                    StartCoroutine(DelayForFeeding(chicken));
                    chickenCount--;
                }
            }
        }
Ejemplo n.º 3
0
        public void EatBeef()
        {
            player = GameObject.FindGameObjectWithTag("Player").GetComponent("Character") as Character;
            if (!isEating)
            {
                PurchaseFood(beef);

                if (isAble(beefCount, 1))
                {
                    isEating = true;
                    MeshRenderer skin = beef.GetComponent("MeshRenderer") as MeshRenderer;
                    skin.enabled = true;
                    player.FeedAnimal((beef.GetComponent("BeefFood") as BeefFood));
                    StartCoroutine(DelayForFeeding(beef));
                    beefCount--;
                }
            }
        }
Ejemplo n.º 4
0
        public void EatFish()
        {
            player = GameObject.FindGameObjectWithTag("Player").GetComponent("Character") as Character;
            if (!isEating)
            {
                PurchaseFood(fish);

                if (isAble(fishCount, 1))
                {
                    isEating = true;
                    SkinnedMeshRenderer skin = fish.GetComponentInChildren(typeof(SkinnedMeshRenderer)) as SkinnedMeshRenderer;
                    skin.enabled = true;
                    player.FeedAnimal((fish.GetComponent("FishFood") as FishFood));
                    StartCoroutine(DelayForFeeding(fish));
                    fishCount--;
                }
            }
        }
Ejemplo n.º 5
0
        public void EatTurkey()
        {
            player = GameObject.FindGameObjectWithTag("Player").GetComponent("Character") as Character;
            if (!isEating)
            {
                PurchaseFood(turkey);

                if (isAble(turkeyCount, 1))
                {
                    isEating = true;
                    MeshRenderer skin = turkey.GetComponent("MeshRenderer") as MeshRenderer;
                    skin.enabled = true;
                    player.FeedAnimal((turkey.GetComponent("TurkeyFood") as TurkeyFood));
                    StartCoroutine(DelayForFeeding(turkey));
                    turkeyCount--;
                }
            }
        }
Ejemplo n.º 6
0
        public void EatTreat()
        {
            player = GameObject.FindGameObjectWithTag("Player").GetComponent("Character") as Character;
            if (!isEating)
            {
                PurchaseFood(treat);

                if (isAble(treatCount, 1))
                {
                    isEating = true;
                    MeshRenderer skin = treat.GetComponentInChildren(typeof(MeshRenderer)) as MeshRenderer;
                    skin.enabled = true;
                    player.FeedAnimal((treat.GetComponent("TreatFood") as TreatFood));
                    StartCoroutine(DelayForFeeding(treat));
                    treatCount--;
                }
            }
        }
Ejemplo n.º 7
0
        public void EatRibs()
        {
            player = GameObject.FindGameObjectWithTag("Player").GetComponent("Character") as Character;
            if (!isEating)
            {
                PurchaseFood(ribs);

                if (isAble(ribCount, 1))
                {
                    isEating = true;
                    MeshRenderer skin = ribs.GetComponent("MeshRenderer") as MeshRenderer;
                    skin.enabled = true;
                    player.FeedAnimal((ribs.GetComponent("RibFood") as RibFood));
                    StartCoroutine(DelayForFeeding(ribs));
                    ribCount--;
                }
            }
        }
Ejemplo n.º 8
0
 void SetupMoveAction()
 {
     gameManager = FindObjectOfType<AnimalGameManager>();
     player = GameObject.FindGameObjectWithTag("Player");
     playerScript = player.GetComponent("Character") as Character;
     anim = player.GetComponent<Animator>();
     nav = GetComponent<NavMeshAgent>();
     nav.enabled = true;
 }