Exemplo n.º 1
0
    public void     SelectDecorationsMenuButtonClicked(int itemIndex)
    {
        if (SoundManager.Instance != null)
        {
            SoundManager.Instance.Play_ButtonClick();
        }
        if (selectedDecotartionMenu == itemIndex)
        {
            //BlockClicks.Instance.SetBlockAll(true);
            //BlockClicks.Instance.SetBlockAllDelay(.5f,false);
            return;
        }
        else
        {
            bEnableCreateDec = false;

            //BlockClicks.Instance.SetBlockAll(true);
            //BlockClicks.Instance.SetBlockAllDelay(.5f,false);
            scrollMenu.ChangeMenu(itemIndex);
            selectedDecotartionMenu = itemIndex;
        }
    }
Exemplo n.º 2
0
    IEnumerator CNextPhase()
    {
        if (phase == 2)        //dodavanje mesa
        {
            //BlockClicks.Instance.SetBlockAll(true);


            imgMeat.gameObject.SetActive(true);
            imgMeat.color = Color.clear;
            imgMeat2.gameObject.SetActive(true);
            imgMeat2.color = Color.clear;
            float pom = 0;

            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                imgMeat.transform.position = Vector3.Lerp(Meat1StartPos.position, Meat1EndPos.position, pom);
                imgMeat.color = new Color(1, 1, 1, pom);
                imgMeat2.transform.position = Vector3.Lerp(Meat2StartPos.position, Meat2EndPos.position, pom);
                imgMeat2.color = imgMeat.color;

                yield return(new WaitForFixedUpdate());
            }
            imgMeat.color  = Color.white;
            imgMeat2.color = Color.white;

            scrollMenu.ChangeMenu(1);
            yield return(new WaitForSeconds(1));

            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ShowItemSound);
            }
            //BlockClicks.Instance.SetBlockAll(false);
            phase = 3;
            Tutorial.Instance.ShowTutorial(1);
        }

        else if (phase == 4)        //dodavanje povrca
        {
            //BlockClicks.Instance.SetBlockAll(true);

            imgVegetables1.gameObject.SetActive(true);
            imgVegetables1.color = Color.clear;
            float pom = 0;

            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                imgVegetables1.transform.position = Vector3.Lerp(Vegetables1StartPos.position, Vegetables1EndPos.position, pom);
                imgVegetables1.color = new Color(1, 1, 1, pom);
                yield return(new WaitForFixedUpdate());
            }
            imgVegetables1.color = Color.white;

            yield return(new WaitForSeconds(.5f));

            //BlockClicks.Instance.SetBlockAll(false);
            phase = 5;
            Tutorial.Instance.ShowTutorial(2);
        }

        else if (phase == 6)        //dodavanje povrca
        {
            //BlockClicks.Instance.SetBlockAll(true);


            imgVegetables2.gameObject.SetActive(true);
            imgVegetables2.color = Color.clear;
            float pom = 0;

            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                imgVegetables2.transform.position = Vector3.Lerp(Vegetables2StartPos.position, Vegetables2EndPos.position, pom);
                imgVegetables2.color = new Color(1, 1, 1, pom);
                yield return(new WaitForFixedUpdate());
            }
            imgVegetables2.color = Color.white;

            scrollMenu.HideMenu();

            yield return(new WaitForSeconds(1));

            //BlockClicks.Instance.SetBlockAll(false);
            phase = 7;

            //yield return new WaitForSeconds(1);
            scrollMenu.gameObject.SetActive(false);
            scrollMenu2.gameObject.SetActive(true);
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ShowItemSound);
            }
            scrollMenu2.ShowMenu(0);
            ScrollMenuDragItem.bEnableDrag = true;
            Tutorial.Instance.ShowTutorial(3);
        }

        else if (phase == 8)        //dodavanje sosa
        {
            yield return(new WaitForSeconds(1));

            //BlockClicks.Instance.SetBlockAll(true);

            Color c = imgSauce.color;
            imgSauce.gameObject.SetActive(true);
            imgSauce.color = Color.clear;
            float pom = 0;

            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                imgSauce.transform.localScale = Vector3.Lerp(Vector3.zero, Vector3.one, pom);
                imgSauce.color = new Color(c.r, c.g, c.b, pom);
                yield return(new WaitForFixedUpdate());
            }
            imgSauce.color = c;

            yield return(new WaitForSeconds(2));

            scrollMenu2.HideMenu();

            yield return(new WaitForSeconds(1));

            //BlockClicks.Instance.SetBlockAll(false);
            phase = 9;
            scrollMenu2.gameObject.SetActive(false);

            animSpringRoll.enabled = true;
            animSpringRoll.Play("P1");
            actionSpringRolls.enabled = true;

            //animButtonNext.gameObject.SetActive(true);
            Tutorial.Instance.ShowTutorial(4);
        }
        else if (phase == 10)
        {
            animSpringRoll.Play("P2");      yield return(new WaitForSeconds(1));  actionSpringRolls.bEnabled = true;
        }
        else if (phase == 11)
        {
            animSpringRoll.Play("P3");      yield return(new WaitForSeconds(1.5f));  actionSpringRolls.bEnabled = true;
        }
        else if (phase == 12)
        {
            Tutorial.Instance.StopTutorial();
            animSpringRoll.Play("P4");
            yield return(new WaitForSeconds(2f));

            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ShowItemSound);
            }
            yield return(new WaitForSeconds(.5f));

            actionSpringRolls.bEnabled       = true;
            actionSpringRolls.bDragForAction = true;
            Tutorial.Instance.ShowTutorial(5);
        }
        else if (phase == 13)
        {
            Tutorial.Instance.StopTutorial();
            animSpringRoll.Play("P5");

            yield return(new WaitForSeconds(1));

            animButtonNext.gameObject.SetActive(true);
            psLevelCompleted.gameObject.SetActive(true);
            psLevelCompleted.Play();
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ActionCompleted);
            }
        }
    }
Exemplo n.º 3
0
    IEnumerator CNextPhase()
    {
        Tutorial.Instance.StopTutorial();

        if (phase == 0)       //sipanje ulja
        {
            Tutorial.Instance.StopTutorial();
            float pom = 0;

            oilFryingPan.color = new Color(1, 1, 1, 0);
            oilFryingPan.gameObject.SetActive(true);

            while (pom < 1)
            {
                pom += Time.deltaTime * .45f;
                oilFryingPan.color = new Color(1, 1, 1, pom);
                yield return(new WaitForEndOfFrame());
            }
            oilFryingPan.color   = Color.white;
            ButtonStove.bEnabled = true;
            phase = 1;
            Tutorial.Instance.ShowTutorial(1);
        }

        else if (phase == 1)        //zagrevanje ulja
        {
            ButtonStove.transform.GetChild(0).gameObject.SetActive(false);
            ButtonStove.transform.GetChild(1).gameObject.SetActive(true);
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.FryingSound);
            }
            int waitTime = 1;
            yield return(new WaitForSeconds(1f));



            Vector3 smStartPos = Plate.position;
            Vector3 smEndPos   = PlateEndPos.position;
            Plate.gameObject.SetActive(true);

            Vector3 arcMax = new Vector3(0, 2, 0);
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ShowItemSound);
            }
            float pom = 0;
            while (pom < 1)
            {
                pom           += .8f * Time.fixedDeltaTime;
                Plate.position = Vector3.Lerp(smStartPos, smEndPos, pom) + pom * (1 - pom) * arcMax;
                yield return(new WaitForFixedUpdate());
            }
            Plate.GetComponent <ItemAction>().bEnabled = true;
            phase = 2;
            Tutorial.Instance.ShowTutorial(2);
        }

        else if (phase == 2)        //sipanje testa u tiganj
        {
            float pom = 0;

            Vector3 smStartPos = noodlesPlate.position;
            Vector3 smEndPos   = NoodlesEndPos.position;
            Vector3 arcMax     = new Vector3(0, .7f, 0);



            while (pom < 1)
            {
                pom           += Time.fixedDeltaTime;
                Plate.rotation = Quaternion.Lerp(Quaternion.identity, Quaternion.Euler(0, 0, -40), pom);
                yield return(new WaitForFixedUpdate());
            }
            while (pom < 1)
            {
                pom += .5f * Time.fixedDeltaTime;
                Quaternion startRotation = noodlesPlate.rotation;
                noodlesPlate.rotation = Quaternion.Lerp(startRotation, Quaternion.identity, pom);
                noodlesPlate.position = Vector3.Lerp(smStartPos, smEndPos, pom) + pom * (1 - pom) * arcMax;
            }

            pom = 0;
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.InsertFruit);
            }
            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                noodlesPlate.rotation = Quaternion.Lerp(noodlesPlate.rotation, Quaternion.identity, pom);
                noodlesPlate.position = Vector3.Lerp(smStartPos, smEndPos, pom * .9f);

                noodlesPlate.localScale = Vector3.Lerp(new Vector3(1, .5f, 1), new Vector3(1, .35f, 1), pom);
                yield return(new WaitForFixedUpdate());
            }
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.FryingSound2);
            }
            noodlesPlate.SetParent(MixHolder);
            noodlesPlate.SetAsFirstSibling();
            pom = .9f;
            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                noodlesPlate.rotation = Quaternion.Lerp(noodlesPlate.rotation, Quaternion.identity, pom);
                noodlesPlate.position = Vector3.Lerp(smStartPos, smEndPos, pom);
                yield return(new WaitForFixedUpdate());
            }
            pom = 0;

            while (pom < 1)
            {
                pom           += Time.fixedDeltaTime;
                Plate.rotation = Quaternion.Lerp(Plate.rotation, Quaternion.identity, pom);
                yield return(new WaitForFixedUpdate());
            }

            pom        = 0;
            smStartPos = Plate.position;
            smEndPos   = smStartPos + new Vector3(-5, 0, 0);
            arcMax     = new Vector3(0, 2, 0);

            while (pom < 1)
            {
                pom           += Time.fixedDeltaTime;
                Plate.position = Vector3.Lerp(smStartPos, smEndPos, pom) + pom * (1 - pom) * arcMax;
                yield return(new WaitForFixedUpdate());
            }
            Plate.gameObject.SetActive(false);

            pom = 0;

            smokeParticles.SetActive(true);

            yield return(new WaitForSeconds(1));

            scrollMenu.gameObject.SetActive(true);
            scrollMenu.ShowMenu(0);
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ShowItemSound);
            }

            phase = 3;

            Tutorial.Instance.ShowTutorial(3);
        }

        else if (phase == 4)        //dodavanje mesa u tiganj
        {
            //BlockClicks.Instance.SetBlockAll(true);


            imgMeat.gameObject.SetActive(true);
            imgMeat.color = Color.clear;
            float pom = 0;

            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                imgMeat.transform.position = Vector3.Lerp(MeatStartPos.position, MeatEndPos.position, pom);
                imgMeat.color = new Color(1, 1, 1, pom);
                yield return(new WaitForFixedUpdate());
            }
            imgMeat.color = Color.white;

            scrollMenu.ChangeMenu(1);
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ShowItemSound);
            }
            yield return(new WaitForSeconds(1));

            //BlockClicks.Instance.SetBlockAll(false);
            phase = 5;
            Tutorial.Instance.ShowTutorial(3);
        }

        else if (phase == 6)        //dodavanje povrca u tiganj 1.
        {
            //BlockClicks.Instance.SetBlockAll(true);


            imgVegetables1.gameObject.SetActive(true);
            imgVegetables1.color = Color.clear;
            float pom = 0;

            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                imgVegetables1.transform.position = Vector3.Lerp(Vegetables1StartPos.position, Vegetables1EndPos.position, pom);
                imgVegetables1.color = new Color(1, 1, 1, pom);
                yield return(new WaitForFixedUpdate());
            }
            imgVegetables1.color = Color.white;

            yield return(new WaitForSeconds(.5f));

            //BlockClicks.Instance.SetBlockAll(false);
            phase = 7;
            Tutorial.Instance.ShowTutorial(3);
        }

        else if (phase == 8)        //dodavanje povrca u tiganj 2.
        {
            //BlockClicks.Instance.SetBlockAll(true);


            imgVegetables2.gameObject.SetActive(true);
            imgVegetables2.color = Color.clear;
            float pom = 0;

            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                imgVegetables2.transform.position = Vector3.Lerp(Vegetables2StartPos.position, Vegetables2EndPos.position, pom);
                imgVegetables2.color = new Color(1, 1, 1, pom);
                yield return(new WaitForFixedUpdate());
            }
            imgVegetables2.color = Color.white;

            scrollMenu.HideMenu();

            yield return(new WaitForSeconds(1));

            //BlockClicks.Instance.SetBlockAll(false);
            phase = 9;
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ShowItemSound);
            }
            animIngredients.gameObject.SetActive(true);
            animIngredients.Play("ShowMenu");

            DragItem.OneItemEnabledNo = 2;
            Tutorial.Instance.ShowTutorial(4);
        }
        else if (phase == 9)        //salt
        {
            Tutorial.Instance.ShowTutorial(5);
            DragItem.OneItemEnabledNo = 3;
            phase = 10;
        }
        else if (phase == 10)        //pepper
        {
            Tutorial.Instance.ShowTutorial(6);
            DragItem.OneItemEnabledNo = 4;
            phase = 11;
        }
        else if (phase == 11)        //soja sos
        {
            DragItem.OneItemEnabledNo = 0;
            phase = 12;

            //prikazivanje soja sosa
            imgSoySauce.gameObject.SetActive(true);
            imgSoySauce.color = Color.clear;
            float pom = 0;
            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                imgSoySauce.color = new Color(1, 1, 1, pom);
                yield return(new WaitForFixedUpdate());
            }

            imgSoySauce.color = Color.white;
            yield return(new WaitForSeconds(3));


            //Prikazivanje kasike za mesanje
            Spatula.gameObject.SetActive(true);
            pom = 0;
            Vector3 arcMax = new Vector3(0, 2, 0);
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ShowItemSound);
            }
            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                Spatula.transform.position = Vector3.Lerp(SpatulaStartPos.position, SpatulaEndPos.position, pom) + pom * (1 - pom) * arcMax;
                yield return(new WaitForFixedUpdate());
            }


            mixingPhase = 1;
            mixingTime  = 0;
            Spatula.GetComponent <Mixer>().Init();
            Mixer.bEnabled = true;

            progressBar.SetProgress(0, false);
            progressBar.gameObject.SetActive(true);


            //sakrivanje zacina
            yield return(new WaitForSeconds(1));

            animIngredients.gameObject.SetActive(false);

            phase = 13;
            Tutorial.Instance.ShowTutorial(7);
        }

        else if (phase == 14)        //EndMixing
        {
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Stop_Sound(SoundManager.Instance.FryingSound);
            }
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Stop_Sound(SoundManager.Instance.FryingSound2);
            }
            //kraj
            phase          = 15;
            Mixer.bMixBowl = false;
            Mixer.bEnabled = false;


            Spatula.GetComponent <Mixer>().enabled = false;

            float pom = 0;

            SpatulaEndPos.position = Spatula.transform.position;

            while (pom < 1)
            {
                pom += 3 * Time.fixedDeltaTime;
                Spatula.transform.position = Vector3.Lerp(SpatulaEndPos.position, SpatulaEndAnimPos.position, pom);
                yield return(new WaitForFixedUpdate());
            }

            Spatula.parent.SetSiblingIndex(2);
            Plate.gameObject.SetActive(true);
            Plate.SetAsFirstSibling();
            MixHolder.parent.parent.parent.SetAsLastSibling();

            EndGameAnim.enabled = true;
            EndGameAnim.Play("endAnim");

            yield return(new WaitForSeconds(4.2f));

            MixHolder.SetParent(Plate);
            smokeParticles.transform.SetParent(Plate);
            Plate.SetParent(GameObject.Find("ActiveItemHolder").transform);
            //povecavanje tanjira
            pom = 0;

            EndGameAnim.enabled    = false;
            SpatulaEndPos.position = Spatula.transform.position;
            Vector3 platePos = Plate.position;
            Vector3 plateSc1 = Plate.localScale;
            Vector3 plateSc2 = Plate.localScale * 1.5f;
            while (pom < 1)
            {
                pom             += Time.fixedDeltaTime;
                Plate.position   = Vector3.Lerp(Plate.position, Vector3.zero, pom);
                Plate.localScale = Vector3.Lerp(plateSc1, plateSc2, pom);
                yield return(new WaitForFixedUpdate());
            }


            psLevelCompleted.gameObject.SetActive(true);
            psLevelCompleted.Play();
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ActionCompleted);
            }
            animButtonNext.gameObject.SetActive(true);

            imgVegetablesSC.sprite  = imgVegetables1.sprite;
            imgVegetables2SC.sprite = imgVegetables2.sprite;
            imgMeatSC.sprite        = imgMeat.sprite;
            transform.GetComponent <CaptureImage>().ScreenshotMeal();
        }


        yield return(new WaitForEndOfFrame());
    }