Example #1
0
    IEnumerator CheckTutorialProgress()
    {
        while (true)
        {
            yield return(new WaitForSeconds(.25f));

            if (stage == 0)
            {
                if (IPL.leftHand && IPL.rightHand)
                {
                    if (IPL.leftHand.GetComponent <Left_VR_Cont>().pullPotion || IPL.rightHand.GetComponent <Right_VR_Cont>().pullPotion)
                    {
                        ProgressTutorial();
                    }
                }
            }
            else if (stage == 1)
            {
                foreach (GameObject pot in GameObject.FindGameObjectsWithTag("Potion"))
                {
                    if (pot.GetComponent <PotionStack>())
                    {
                        PotionStack p = pot.GetComponent <PotionStack>();
                        if (p.contents.Count == 2)
                        {
                            if (p.contents[0].type * 10 + p.contents[1].type == 12 || p.contents[0].type * 10 + p.contents[1].type == 21) //yellow + magenta
                            {
                                ProgressTutorial();
                                break;
                            }
                        }
                    }
                }
            }
            else if (stage == 2)
            {
                foreach (PotionStack p in boiler.potionsOnBoiler)
                {
                    if (p.DeterminePotionType() == 1)
                    {
                        ProgressTutorial();
                        break;
                    }
                }
            }
            else if (stage == 3)
            {
                if ((IPL.GetRightButtonInteracting() && (IPL.rightHand.CurrentlyInteracting || (IPL.rightHand.GetComponent <Right_VR_Cont>().objectHovering&& IPL.GetRightTriggerInteracting()))) || (IPL.GetLeftButtonInteracting() && (IPL.leftHand.CurrentlyInteracting || (IPL.leftHand.GetComponent <Left_VR_Cont>().objectHovering&& IPL.GetLeftTriggerInteracting()))))
                {
                    ProgressTutorial();
                }
            }
            else if (stage == 4)
            {
                if (GameObject.FindGameObjectWithTag("Enemy").GetComponent <Goblin_ro_ctrl>().dead)
                {
                    ProgressTutorial();
                }
            }
            else if (stage == 5)
            {
                if (allEnemiesDead())
                {
                    ProgressTutorial();
                }
            }
        }
    }