private IEnumerator NewShapeEffectCorutine(ShapeScriptable _newShape) { float animDur = 0.03f; int currentShapeIndex = ShapeController.GetCurrentShapeIndex(); readInput = false; Direction randomDir = UnityEngine.Random.Range(0, 2) == 0 ? Direction.Right : Direction.Left; for (int i = 0; i < 15; i++) { gameplayPanel.UpdateShape(randomDir, ShapeController.GetShapeByIndex(currentShapeIndex), ShapeController.GetShapeByIndex(currentShapeIndex - 1), ShapeController.GetShapeByIndex(currentShapeIndex + 1), true, animDur); currentShapeIndex++; if (randomDir == Direction.Right) { SwipeController.RightSwipe(); } else { SwipeController.LeftSwipe(); } yield return(new WaitForSeconds(animDur)); } shapeCtrl.ChangeShape(_newShape); readInput = true; }
private void OnGameplayFadeOutCallback() { bgMng.StartBackground(); videoAlreadyWhatched = false; DifficultyManager.StartGame(); int firstGame = PlayerPrefs.GetInt("Tutorial", 0); if (firstGame == 0) { readInput = false; isTutorial = true; tutorialTimes++; gameplayPanel.EnableTutorialPanel(true); spawnCtrl.StartSpawn(ShapeController.GetShapeByIndex(ShapeController.GetCurrentShapeIndex() - 1)); CoroutineController.StartRoutine(StartTutotrial, 6.5f); } else { spawnCtrl.StartSpawn(); readInput = true; isTutorial = false; } startState = true; }
private void HandleOnShapeChange(Direction _swipeDir, ShapeScriptable _newShape, bool _animation) { int currentShapeIndex = ShapeController.GetCurrentShapeIndex(); gameplayPanel.UpdateShape(_swipeDir, _newShape, ShapeController.GetShapeByIndex(currentShapeIndex - 1), ShapeController.GetShapeByIndex(currentShapeIndex + 1), _animation, changeShapeDelayTime); }