IEnumerator RestartCoroutine()
    {
        // Fade out BGM
        while (bgm.volume > 0)
        {
            bgm.volume -= 1f * Time.deltaTime / .5f;
            yield return(null);
        }
        timeLeft       = numSeconds;
        timerText.text = timeLeft.ToString();
        won            = false;

        // Restart all flowers
        for (int i = 0; i < flowers.Count; i++)
        {
            flowers[i].Restart();
        }

        // Get rid of all venus fly traps currently in the scene
        GameObject[] vfts = GameObject.FindGameObjectsWithTag("VFT");
        for (int i = 0; i < vfts.Length; i++)
        {
            VenusFlyTrap vft = vfts[i].GetComponent <VenusFlyTrap>();
            if (vft != null)
            {
                if (vft.beeTrapped != null)
                {
                    vft.ReleaseBee();
                }
                vft.StartDestroy();
            }
        }

        // Put bees in original positions
        for (int i = 0; i < beeControllers.Length; i++)
        {
            beeControllers[i].Restart();
        }

        timerBar.Restart();
        winningStuffPlays    = false;
        playedHalfWay        = false;
        startedCountDownClip = false;
        state = 0;
        foreach (GameObject vrui in VRUIs)
        {
            vrui.SetActive(false);
        }
        foreach (GameObject xboxui in xboxUIs)
        {
            xboxui.SetActive(false);
        }
        VRUIs[mantisScore + beeScore].SetActive(true);
        xboxUIs[mantisScore + beeScore].SetActive(true);
    }
Beispiel #2
0
        public static void Main()
        {
            CupOfCoffee myCup = new CupOfCoffee();

            myCup.beanType    = "myBean";
            myCup.instant     = true;
            myCup.milk        = false;
            myCup.sugar       = 1;
            myCup.description = "zoo coffee shop";
            byte mySugar = myCup.AddSugar(5);

            for (int i = 1; i <= 10; i++)
            {
                CupOfCoffee.myCupNums++;

                WriteLine(CupOfCoffee.brand);
                WriteLine(myCup.beanType);
                WriteLine(myCup.instant);
                WriteLine(myCup.milk);
                WriteLine(myCup.sugar);
                WriteLine(myCup.description);
                WriteLine("interface: " + mySugar);
                WriteLine("myCupNums: " + CupOfCoffee.myCupNums + "\n");
            }

            //Shop myShop = new Shop();

            //myCup.Dispose();
            using (myCup)
            {
                //Auto Dispose()
            }


            Cow     myCow     = new Cow(true);
            Chicken myChicken = new Chicken(false);

            myCow.EatFood();
            myChicken.EatFood();
            myCow.SupplyMilk();

            Animal myAnimal = myCow;

            myAnimal.EatFood();
            Animal[] animals = new Animal[5];

            //myAnimal.Moo();
            Cow myNewCow = (Cow)myAnimal;

            myAnimal = (Cow)myAnimal;
            myNewCow.Moo();

            IConsume comsumeInterface;

            comsumeInterface = myCow;
            comsumeInterface.Death();
            comsumeInterface = myChicken;
            comsumeInterface.Death();

            Animal myDeathAnimal = new Animal();

            comsumeInterface = myDeathAnimal;
            comsumeInterface.Death();

            VenusFlyTrap myVenusFlyTrap = new VenusFlyTrap();

            comsumeInterface = myVenusFlyTrap;
            comsumeInterface.Death();

            Child myChild = new Child();

            myChild.Main1();

            WriteLine(myChild);
        }