Example #1
0
    // Update is called once per frame
    void Update()
    {
        if ((Vector3.Distance(pot.position, potLocation.position) < trigDis))
        {
            print("Pot is where it should be");
            potPlace = true;
        }
        else
        {
            potPlace = false;
        }

        if (potPlace == true)
        {
        }

        if (potPlace == false)
        {
        }

        if ((Vector3.Distance(cup.position, cupLocation.position) < trigDis))
        {
            print("cup is where it should be");
            cupPlace = true;
        }
        else
        {
            cupPlace = false;
        }

        if (cupPlace == true)
        {
        }

        if (cupPlace == false)
        {
        }

        if ((Vector3.Distance(kettle.position, kettleLocation.position) < trigDis))
        {
            print("kettle is where it should be");
            kettlePlace = true;
        }
        else
        {
            kettlePlace = false;
        }

        if (kettlePlace == true)
        {
            StartCoroutine(Boiling());
        }

        if (kettlePlace == false)
        {
        }

        if (KBoiled == true)
        {
            steam.SetActive(true);
        }

        /*else {
         *      steam.SetActive (false);
         * }*/


        if ((Vector3.Distance(teaBag.position, pot.position) < trigDis2))
        {
            if (Input.GetMouseButtonDown(0))
            {
                StartCoroutine(TeaInPot());
            }
            print("tea in pot");
        }

        if (teaInPot == true && KBoiled == true)
        {
            if ((Vector3.Distance(kettle.position, pot.position) < trigDis2))
            {
                //DD.GetComponent<DragDrop1> ().teaPlace = true;
                print("kettle in spot");
                if (Input.GetMouseButtonDown(0))
                {
                    StartCoroutine(Brewing());
                    print("check teaBrewing");
                }
            }

            /*
             * if ((Vector3.Distance (kettle.position, pot.position) < trigDis2)){
             *      DD.GetComponent<DragDrop1> ().teaPlace = false;
             * }*/
        }

        if (teaBrewing == true)
        {
            StartCoroutine(Brewing());
            //print ("check teaBrewing");
        }

        if (teaBrewed == true)
        {
            print("tea is brewed");
            if ((Vector3.Distance(cup.position, pot.position) < trigDis2))
            {
                print("tea is ready to pour");
                if (Input.GetMouseButtonDown(0))
                {
                    teaDone = true;
                    Tea.SetActive(true);
                    acheive3.SetActive(true);
                }
            }
        }

        if (teaDone == true)
        {
            Done.SetActive(true);
            if ((Vector3.Distance(cup.position, honey.position) < trigDis2))
            {
                print("Honey Near Tea");
                if (Input.GetMouseButtonDown(0))
                {
                    print("Honey is in the tea");
                    //Tea.GetComponent<ChangeColor> ().ColorChange();
                    ChangeColor Col = Tea.GetComponent <ChangeColor>();
                    Col.ColorChange(Color.yellow);
                    //StartCoroutine ("Changing");
                }
            }

            if ((Vector3.Distance(cup.position, milk.position) < trigDis2))
            {
                print("Milk Near Tea");
                if (Input.GetMouseButtonDown(0))
                {
                    print("Milk is in the tea");
                    //ChangeColor Col = Tea.GetComponent<ChangeColor>();
                    //Col.ColorChange(Color.white);
                    milkTea.SetActive(true);
                }
            }
        }
    }