private void ShowTVQuestions() { if (gameCycle == GameCycle.FourthStep) { AlternateInterface(3); RandomTestSelection(); activeCamera = ActiveCamera.TVCamera; camMReference.TypesOfCameras(activeCamera); animReference.TVAnimations(true); timerToLooseQuestion = 20f; while (timerToLooseQuestion > 0) { if (questionState == QuestionState.Answered) { AnswerResult(buttonsGame.SendAnswerResult()); break; } else if (questionState == QuestionState.NotAnswered) { timerToLooseQuestion -= Time.time; if (timerToLooseQuestion <= 0) { StartCoroutine(TimeToEndTurn(4f)); } } } } void RandomTestSelection() { randomQuestion = Random.Range(0, generalCultureQuestions.Length); buttonsGame.ReceiveRandomValue(randomQuestion); uIGameReference.QuestionAssignation(randomQuestion, 0); randomAnswerList = new List <int>(3); randomWrongAnswer = new List <int>(2); for (int i = 0; i < randomAnswerList.Capacity; i++) { randomSelections = Random.Range(0, randomAnswerList.Capacity); randomWrongSelections = Random.Range(0, randomWrongAnswer.Capacity); if (randomAnswerList.Capacity != 1) { if (randomWrongAnswer.Capacity != 1) { uIGameReference.AnswerAssignations(1, randomSelections, randomQuestion); } else { uIGameReference.AnswerAssignations(2, randomSelections, randomQuestion); } randomAnswerList.Remove(randomSelections); randomWrongAnswer.Remove(randomWrongSelections); } else { uIGameReference.AnswerAssignations(3, randomSelections, randomQuestion); } } } void AnswerResult(bool isAcerted) { platformScript.SendCurrentPlatform(wayPoints[currentTarget].position, platformType); if (isAcerted && platformType != PlatformType.Neutral) { MovingTypeAssignation(true); gameCycle = GameCycle.ThirdStep; } else if (isAcerted == false && platformType != PlatformType.Neutral) { MovingTypeAssignation(false); } uIGameReference.QuestionAssignation(randomQuestion, 1); if (platformType == PlatformType.Neutral) { StartCoroutine(TimeToEndTurn(4f)); } } void MovingTypeAssignation(bool isAcerted) { if (isAcerted) { switch ((int)platformType) { case 0: movingType = MovingType.Waiting; break; case 1: movingType = MovingType.Advancing; break; case 2: movingType = MovingType.Waiting; break; case 3: movingType = MovingType.Teleporting; break; } } else { switch ((int)platformType) { case 0: movingType = MovingType.Waiting; break; case 1: movingType = MovingType.Waiting; break; case 2: movingType = MovingType.Reversing; break; case 3: movingType = MovingType.Teleporting; break; } } } void EventLimiter() // funcion que cumple el proposito de limitar el maximo de movimiento { //if (intAdvanceLimit >= 2) // isLimAdvanceOver = true; //else if (intReverseLimit >= 2) // isLimReverseOver = true; //else if (intMisteryLimit >= 2) // isLimMisteryOver = true; //else //{ // isLimAdvanceOver = false; // isLimReverseOver = false; // isLimMisteryOver = false; //} } }