Example #1
0
    IEnumerator CNextPhase()
    {
        if (SoundManager.Instance != null)
        {
            SoundManager.Instance.Play_ButtonClick();
        }
        //BlockClicks.Instance.SetBlockAll(true);
        if (phase == 0)
        {
            phase = 1;
            scrollMenu.HideMenu();
            psLevelCompleted.gameObject.SetActive(true);
            psLevelCompleted.Play();
            yield return(new WaitForSeconds(1));

            //SNIMANJE


            CaptureImage captureImage = transform.GetComponent <CaptureImage>();

            SC_imgFortuneCookie.transform.parent.localScale = 1.8f * Vector3.one;
            captureImage.ScreenshotMeal();

            yield return(new WaitForSeconds(1));

            //load next
            StartCoroutine("LoadNextScene");
            //TODO: MINJA  INTERSTITIAL_NEXT
            //AdsManager.Instance.ShowInterstitial(AdsManager.INTERSTITIAL_NEXT);
            GlobalVariables.ShowHomeNextInterstitial("next");
        }

        yield return(new WaitForEndOfFrame());
    }
 public void NextPhase(string _phase)
 {
     if (_phase.StartsWith("D"))
     {
         DragItem.OneItemEnabledNo = 0;
         int i = int.Parse(_phase.Substring(1, 1)) - 1;
         animKneadDough = Dough[i].GetComponent <Animator>();
         phase++;
         StartCoroutine("CNextPhase");
     }
     else if (_phase.StartsWith("F"))
     {
         scrollMenu.HideMenu();
         if (phase == 1)
         {
             Tutorial.Instance.ShowTutorial(3);
         }
     }
     else if (_phase == "End")
     {
         sweetDumplingsCount++;
         phase++;
         Tutorial.Instance.StopTutorial();
         if (phase == 8)
         {
             StartCoroutine("CNextPhase");
         }
         else
         {
             DragItem.OneItemEnabledNo = 1;
         }
     }
 }
Example #3
0
    IEnumerator Start()
    {
        //GameData.dimSumFlavors  = new int[] {-1,1,0,3};
        if (GameData.dimSumFlavors[0] > -1)
        {
            dimSumPieces[0].color = dimSumColors.colors[GameData.dimSumFlavors[0]];
        }
        if (GameData.dimSumFlavors[1] > -1)
        {
            dimSumPieces[1].color = dimSumColors.colors[GameData.dimSumFlavors[1]];
        }
        if (GameData.dimSumFlavors[2] > -1)
        {
            dimSumPieces[2].color = dimSumColors.colors[GameData.dimSumFlavors[2]];
        }
        if (GameData.dimSumFlavors[3] > -1)
        {
            dimSumPieces[3].color = dimSumColors.colors[GameData.dimSumFlavors[3]];
        }

        DragItem.OneItemEnabledNo = 0;
        scrollMenu.HideMenu();
        psSmoke.gameObject.SetActive(false);
        //BlockClicks.Instance.SetBlockAll(true);
        animButtonNext.gameObject.SetActive(false);
        yield return(new WaitForSeconds(.1f));


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

        //LevelTransition.Instance.ShowScene();

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

        //BlockClicks.Instance.SetBlockAll(false);

        DragItem.OneItemEnabledNo = 1;

        ScrollMenuDragItem.bEnableDrag = false;
        Tutorial.Instance.ShowTutorial(0);
        EscapeButtonManager.AddEscapeButonFunction("ButtonHomeClicked");
    }
Example #4
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);
            }
        }
    }
    IEnumerator CNextPhase()
    {
        Tutorial.Instance.StopTutorial();

        if (phase == 0)       //sipanje arome
        {
            yield return(new WaitForSeconds(1));

            Color c = sweetDumplingsDoughColors.colors[GameData.selectedFlavor];
            knd.color = c;
            float pom = 0;

            imgFlavorDough.color = new Color(c.r, c.g, c.b, 0);
            Vector3 startScale = .3f * Vector3.one;
            imgFlavorDough.gameObject.SetActive(true);
            while (pom < 1)
            {
                pom += Time.deltaTime * .45f;
                imgFlavorDough.color = new Color(c.r, c.g, c.b, pom * 2);
                imgFlavorDough.transform.localScale = Vector3.Lerp(startScale, Vector3.one, pom);
                yield return(new WaitForEndOfFrame());
            }
            imgFlavorDough.color = new Color(c.r, c.g, c.b, 1);
            yield return(new WaitForSeconds(1));

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

            GameObject.Destroy(scrollMenu.gameObject);

            phase           = 1;
            knd.enabled     = true;
            knd.bEnableDrag = true;

            Tutorial.Instance.ShowTutorial(1);
        }
        else if (phase == 1)        //seckanje testa
        {
            for (int i = 1; i <= 4; i++)
            {
                //zamena boje
                DoughCut.transform.Find("P" + i.ToString()).GetComponent <Image>().color = sweetDumplingsDoughColors.colors[GameData.selectedFlavor];

                //DoughCut.transform.FindChild("P"+i.ToString()).GetComponent<Image>().material.SetColor("_Color",sweetDumplingsDoughColors.colors[ GameData.selectedFlavor]);
            }
            //prikazivanje  gotovog testa
            float pom  = 0;
            float pom2 = 0;

            while (pom < 1)
            {
                DoughCut.gameObject.SetActive(true);
                DoughCut.alpha = 0;
                pom           += Time.deltaTime;
                DoughKnead.transform.localScale = Vector3.Lerp(DoughKnead.transform.localScale, DoughKneadEndScale, pom);
                if (DoughCut.alpha < 1)
                {
                    DoughCut.alpha = pom * 1.5f;
                }
                if (pom > 0.5f)
                {
                    pom2            += 2 * Time.deltaTime;
                    DoughKnead.alpha = 1 - pom2;
                }
                yield return(new WaitForEndOfFrame());
            }

            DoughKnead.gameObject.SetActive(false);
            DoughCut.alpha = 1;
            yield return(new WaitForEndOfFrame());


            cs.knife.gameObject.SetActive(true);
            cs.InitKnife();
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ShowItemSound);
            }
            Tutorial.Instance.ShowTutorial(2);
        }
    }
Example #6
0
    IEnumerator CNextPhase()
    {
        if (phase == 0)      //ukljucena masina
        {
            Tutorial.Instance.StopTutorial();
            //BlockClicks.Instance.SetBlockAll(true);

            float   pom = 0;
            Vector3 sp  = Cable.localPosition;
            while (pom < 1)
            {
                pom += 1.5f * Time.deltaTime;
                Cable.localPosition = Vector3.Lerp(sp, Vector3.zero, pom);
                yield return(new WaitForEndOfFrame());
            }
            Cable.localPosition = Vector3.zero;


            //BlockClicks.Instance.SetBlockAll(false);
            ButtonDimSumMachine.bEnabled = true;


            phase = 1;
            yield return(new WaitForEndOfFrame());

            ScrollMenuDragItem.bEnableDrag = true;
            scrollMenu.gameObject.SetActive(true);
            scrollMenu.ShowMenu(0);
            Tutorial.Instance.ShowTutorial(1);
        }
        else if (phase > 0 && phase < 5)        //ukljucena je masina za pravljenje testa
        {
            Tutorial.Instance.StopTutorial();
            ScrollMenuDragItem.bEnableDrag = false;
            if (selectedFlavor >= 0)
            {
                dimSumPiece[phase - 1].color = dimSumColors.colors[selectedFlavor];
                foreach (Transform t in dimSumPiece[phase - 1].transform)
                {
                    if (t.CompareTag("ScrollMenuColor"))
                    {
                        t.GetComponent <Image>().color = dimSumColors.colors[selectedFlavor];
                    }
                }
            }

            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.MachineOnSound);
            }
            ButtonDimSumMachine.transform.GetChild(0).gameObject.SetActive(false);
            ButtonDimSumMachine.transform.GetChild(1).gameObject.SetActive(true);
            ButtonDimSumMachine.transform.GetChild(2).gameObject.SetActive(true);

            animDimSumMachine.Play("p" + phase);
            yield return(new WaitForSeconds(3));

            ButtonDimSumMachine.bEnabled = true;
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Stop_Sound(SoundManager.Instance.MachineOnSound);
            }
            ButtonDimSumMachine.transform.GetChild(0).gameObject.SetActive(true);
            ButtonDimSumMachine.transform.GetChild(1).gameObject.SetActive(false);
            ButtonDimSumMachine.transform.GetChild(2).gameObject.SetActive(false);

            GameData.dimSumFlavors[phase - 1] = selectedFlavor;

            phase++;
            if (phase == 5)            //ZAVRSENO PRESOVANJE KOMADICA TESTA I POTREBNO JE POJAVITI TANJIR SA FILOM, KASIKU...
            {
                bShowTut2 = false;
                yield return(new WaitForSeconds(1));

                Cable.gameObject.SetActive(false);
                scrollMenu.HideMenu();
                animDimSumMachine.Play("Hide");
                Plate.SetParent(PlateHolder);
                DoughParent.SetParent(Plate);
                DoughParent.SetAsFirstSibling();
                yield return(new WaitForSeconds(2));

                scrollMenu.gameObject.SetActive(false);
                animDimSumMachine.gameObject.SetActive(false);


                fillPlateHolder.gameObject.SetActive(true);

                Vector3 smStartPos = fillPlateHolder.position;
                Vector3 smEndPos   = fillPlateEndPos.position;
                Vector3 bsStartPos = bambooSteamer.position;
                Vector3 bsEndPos   = bambooSteamerEndPos.position;
                Vector3 scStartPos = scoop.transform.position;
                Vector3 scEndPos   = scoopEndPos.position;
                Plate.gameObject.SetActive(true);
                scoop.gameObject.SetActive(true);
                bambooSteamer.gameObject.SetActive(true);

                Vector3 arcMax = new Vector3(0, 2, 0);

                float pom = 0;
                while (pom < 1)
                {
                    pom += .8f * Time.fixedDeltaTime;
                    fillPlateHolder.position = Vector3.Lerp(smStartPos, smEndPos, pom) + pom * (1 - pom) * arcMax;
                    bambooSteamer.position   = Vector3.Lerp(bsStartPos, bsEndPos, pom) + pom * (1 - pom) * arcMax;

                    yield return(new WaitForFixedUpdate());
                }

                phase = 6;

                smStartPos = dimSumPiece[3].transform.position;
                smEndPos   = FillDoughPos.position;

                pom = 0;

                //podesava se image punjenja
                scoop.imgFillOnDough = dimSumPiece[3].transform.GetChild(0).GetComponent <Image>();

                if (SoundManager.Instance != null)
                {
                    SoundManager.Instance.Play_Sound(SoundManager.Instance.ShowItemSound);
                }
                while (pom < 1)
                {
                    pom += Time.fixedDeltaTime;
                    dimSumPiece[3].transform.position   = Vector3.Lerp(smStartPos, smEndPos, pom);
                    dimSumPiece[3].transform.localScale = Vector3.Lerp(Vector3.one, 1.8f * Vector3.one, pom);
                    scoop.transform.position            = Vector3.Lerp(scStartPos, scEndPos, pom) + pom * (1 - pom) * arcMax;
                    yield return(new WaitForFixedUpdate());
                }
                dimSumPiece[3].transform.SetParent(FillDoughPos);
                dimSumLeftToDo = 3;
                Tutorial.Instance.ShowTutorial(3);
            }
            else
            {
                ScrollMenuDragItem.bEnableDrag = true;
            }
        }
    }
    IEnumerator WaitNextPhase(int phase)
    {
        Tutorial.Instance.StopTutorial();
        yield return(new WaitForEndOfFrame());

        if (phase == 1)
        {
            yield return(new WaitForSeconds(.5f));

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

            animBowl.Play("Water");
        }

        else if (phase == 2)
        {
            yield return(new WaitForSeconds(1.3f));

            animBowl.Play("InsertFlour");

            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.StopAndPlay_Sound(SoundManager.Instance.SugarSound);
            }
        }
        else if (phase == 3)
        {
            yield return(new WaitForSeconds(.8f));

            animBowl.Play("InsertSugar");

            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.StopAndPlay_Sound(SoundManager.Instance.SugarSound);
            }
        }
        else if (phase == 4)
        {
            scrollMenu.gameObject.SetActive(true);
            yield return(new WaitForEndOfFrame());

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

            scrollMenu.HideMenu();
            Debug.Log("HIDE");
            yield return(new WaitForSeconds(1));

            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.ShowItemSound);
            }
            cgMixerHolder.gameObject.SetActive(true);
            cgMixerHolder.alpha = 0;
            float pom = 0;
            while (pom < 1)
            {
                pom += Time.deltaTime * 3;
                yield return(new WaitForEndOfFrame());

                cgMixerHolder.alpha = pom;
            }
            scrollMenu.gameObject.SetActive(false);
            Tutorial.Instance.ShowTutorial(5);
            //Tutorial.Instance.StartCoroutine("ShowMixerTut");
        }
    }
Example #8
0
    IEnumerator CNextPhase()
    {
        Tutorial.Instance.StopTutorial();

        if (phase == 1)
        {
            phase = 2;
            Tutorial.Instance.StopTutorial();

            scrollMenu.HideMenu();
            yield return(new WaitForSeconds(.2f));

            bowl.gameObject.SetActive(true);
            foreach (Transform t in bowl.GetChild(0))
            {
                if (t.CompareTag("ScrollMenuColor"))
                {
                    t.GetComponent <Image>().color = smgChocolate.itemColors.colors[GameData.chocolateFillColor];
                }
            }

            float   pom    = 0;
            Vector3 arcMax = new Vector3(0, .7f, 0);
            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                bowl.transform.position = Vector3.Lerp(BowlStartPos.position, BowlEndPos.position, pom) + pom * (1 - pom) * arcMax;
                yield return(new WaitForFixedUpdate());
            }
            yield return(new WaitForFixedUpdate());

            bowl.GetComponent <ItemAction>().enabled = true;
            BowlCollider.SetActive(true);
            Tutorial.Instance.ShowTutorial(1);
        }
        else if (phase == 3)
        {
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.InsertFruit);
            }
            yield return(new WaitForSeconds(0.5f));

            for (int i = bowl.GetChild(0).childCount - 1; i >= 0; i--)
            {
                Transform t = bowl.GetChild(0).GetChild(i);
                if (t.CompareTag("ScrollMenuColor"))
                {
                    t.SetParent(Dish.GetChild(4));
                }
            }
            yield return(new WaitForSeconds(4.0f));



            float   pom    = 0;
            Vector3 arcMax = new Vector3(0, .7f, 0);
            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                bowl.transform.position = Vector3.Lerp(BowlEndPos.position, BowlStartPos.position, pom) + pom * (1 - pom) * arcMax;
                yield return(new WaitForFixedUpdate());
            }

            ButtonStove.enabled  = true;
            ButtonStove.bEnabled = true;
            bowl.gameObject.SetActive(false);
            Tutorial.Instance.ShowTutorial(2);
        }
        else if (phase == 4)
        {
            ButtonStove.transform.GetChild(0).gameObject.SetActive(false);
            ButtonStove.transform.GetChild(1).gameObject.SetActive(true);

            float pom = 0;
            progressBar.SetProgress(0, false);
            progressBar.gameObject.SetActive(true);
            yield return(new WaitForSeconds(1f));

            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Play_Sound(SoundManager.Instance.FryingSound);
            }
            CanvasGroup cg = Dish.GetChild(4).GetComponent <CanvasGroup>();
            Color       c  = smgChocolate.itemColors.colors[GameData.chocolateFillColor];

            Vector3 MeltedChocolateStartPos = imgMeltedChocolate.transform.position;
            while (pom < .5f)
            {
                progressBar.SetProgress(pom, false);
                pom += .1f * Time.fixedDeltaTime;
                yield return(new WaitForFixedUpdate());

                cg.alpha = 1 - 2 * pom;
                imgMeltedChocolate.color = new Color(c.r, c.g, c.b, pom * 2);
                imgMeltedChocolate.transform.position = Vector3.Lerp(MeltedChocolateStartPos, MeltedChocolateEndPos.position, pom * 2);
            }
            chocolateBoilParticles.gameObject.SetActive(true);
            chocolateBoilParticles.Play();

            cg.gameObject.SetActive(false);
            imgMeltedChocolate.color = c;
            while (pom < 1f)
            {
                progressBar.SetProgress(pom, false);
                pom += 0.1f * Time.fixedDeltaTime;
                yield return(new WaitForFixedUpdate());
            }

            progressBar.SetProgress(1, false);

            ButtonStove.transform.GetChild(0).gameObject.SetActive(true);
            ButtonStove.transform.GetChild(1).gameObject.SetActive(false);
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.Stop_Sound(SoundManager.Instance.FryingSound);
            }
            yield return(new WaitForSeconds(.1f));

            progressBar.gameObject.SetActive(false);
            chocolateBoilParticles.Stop();

            yield return(new WaitForSeconds(1f));

            chocolateBoilParticles.gameObject.SetActive(false);
            Tray.gameObject.SetActive(true);

            for (int i = 0; i < FortuneCookies.Length; i++)
            {
                FortuneCookies[i].transform.GetChild(0).GetComponent <Image>().color             = itemsColors.colors[(GameData.selectedFlavor > -1)? GameData.selectedFlavor : 0];
                FortuneCookies[i].transform.GetChild(0).GetChild(0).GetComponent <Image>().color = smgChocolate.itemColors.colors[GameData.chocolateFillColor];
            }


            pom = 0;
            Vector3 arcMax = new Vector3(0, .7f, 0);
            while (pom < 1)
            {
                pom += Time.fixedDeltaTime;
                Tray.transform.position = Vector3.Lerp(TrayStartPos.position, TrayEndPos.position, pom) + pom * (1 - pom) * arcMax;
                yield return(new WaitForFixedUpdate());
            }


            phase = 5;

            DragItem.OneItemEnabledNo = 1;
            Tutorial.Instance.ShowTutorial(3);
        }
    }
    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());
    }