public void NextPhase(string _phase) { if (_phase.StartsWith("SD")) { //Tutorial.Instance.StopTutorial(); //int rb =( int.Parse(_phase.Substring(2,1))-1); spoon.TargetPoint = new Transform[1] { EatPos }; activeItem = spoon.activeItem; } else if (_phase == "EndDrag") { if (SoundManager.Instance != null) { SoundManager.Instance.StopAndPlay_Sound(SoundManager.Instance.EatSound); } //dodaj PARTICLES dumplingsLeft--; // Debug.Log("dumplingsLeft: " + dumplingsLeft); if (dumplingsLeft == 0) { GameObject.Destroy(activeItem.gameObject); //Debug.Log("SVE JE POJEDENO"); spoon.bIskoriscen = true; spoon.bDrag = false; spoon.StartMoveBack(); gameTimer.StopTimer(); StartCoroutine("LevelCompleted"); } else { spoon.TargetPoint = new Transform[dumplingsLeft]; int j = 0; int k = 0; for (int i = 0; i < dumplings.Length; i++) { if (dumplings[i] != null && dumplings[i].name == activeItem.name) { dumplings[i] = null; } if (dumplings[i] != null) { spoon.TargetPoint[j] = dumplings[i]; j++; } } GameObject.Destroy(activeItem.gameObject); } } }
//------------------------------------------------------------ public void NextPhase(string _phase) { if (_phase == "PlateNoodles" || _phase == "StoveOn" || _phase == "Strainer") { StartCoroutine("CNextPhase"); } else if (_phase.StartsWith("SD")) { Tutorial.Instance.StopTutorial(); //int rb =( int.Parse(_phase.Substring(2,1))-1); spoon.TargetPoint = new Transform[1] { dumpplingsEndPositions[dumplingsDone] }; } else if (_phase == "EndDrag") { dumplingsDone++; if (dumplingsDone == 4) { Debug.Log("SVE JE UBACENO"); spoon.bIskoriscen = true; spoon.bDrag = false; spoon.StartMoveBack(); phase = 4; StartCoroutine("CNextPhase"); } else { spoon.TargetPoint = new Transform[dumpplings.Length - dumplingsDone]; int j = 0; for (int i = 0; i < dumpplings.Length - dumplingsDone; i++) { while (dumpplings[j].parent != MixHolder && (j < dumpplings.Length - 1)) { j++; } spoon.TargetPoint[i] = dumpplings[j]; j++; } } } }