Exemplo n.º 1
0
        /// <summary>
        /// method to check the userinput with the animal names
        /// </summary>
        private void CheckName()
        {
            foreach (var anml in spawnedAnimals)
            {
                Animal animal = anml.GetComponent <Animal>();

                if (input == animal.name)
                {
                    animal.SayHello();
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// to let all the animals say hello
        /// </summary>
        private void SayHi()
        {
            foreach (var animal in spawnedAnimals)
            {
                Animal animals = animal.GetComponent <Animal>();

                if (animals != null)
                {
                    animals.SayHello();
                }
            }
        }