public void ChangePlayer() { if (canChangePlayer) { cindyEnabled = !cindyEnabled; CindyLevels.SetActive(cindyEnabled); BrendaLevels.SetActive(!cindyEnabled); Cindy.SetActive(cindyEnabled); Brenda.SetActive(!cindyEnabled); if (cindyEnabled) { UIController.ChangeMode(UILayer.CindyStats); } else { UIController.ChangeMode(UILayer.BrendaStats); } player = cindyEnabled ? Cindy : Brenda; //player.GetComponent<PlayerPlatformController>().RestartPlayer(); mainCamera.GetComponent <CameraBehaviour>().SetTarget(player); } }
public void InitializeConversationBox() { UIController.ChangeMode(UILayer.Conversation); opennedConversationBoxPosition = opennedConversationBoxPlace.GetComponent <RectTransform>().anchoredPosition; //Guardamos en las variables Vector2 las posiciones y tamaños que nos interesan opennedConversationBoxSize = opennedConversationBoxPlace.GetComponent <RectTransform>().sizeDelta; closedConversationBoxPosition = Vector2.zero; closedConversationBoxSize = Vector2.zero; opennedOptionsBoxPosition = opennedOptionsBoxPlace.GetComponent <RectTransform>().anchoredPosition; opennedOptionsBoxSize = opennedOptionsBoxPlace.GetComponent <RectTransform>().sizeDelta; closedOptionsBoxPosition = Vector2.zero; closedOptionsBoxSize = Vector2.zero; conversationBox.GetComponent <RectTransform>().anchoredPosition = closedConversationBoxPosition; //Inicializamos las posiciones y tamaños de los cuadros conversationBox.GetComponent <RectTransform>().sizeDelta = closedConversationBoxSize; optionsBox.GetComponent <RectTransform>().anchoredPosition = closedOptionsBoxPosition; optionsBox.GetComponent <RectTransform>().sizeDelta = closedOptionsBoxSize; conversationBoxOpenned = false; //El cuadro de texto está cerrado al principio optionsBoxReady = false; //Igual con el cuadro de opciones conversationText.text = ""; //Vacíamos la variable de texto preparedForNewText = true; //Está preparado para lanzar un nuevo texto optionsTexts[0].text = "Sí"; //Opción 1 optionsTexts[1].text = "No"; //Opción 2 pointingArrowPos = 0; //Teóricamente colocada en la opción 1 pointingArrow.GetComponent <RectTransform>().anchoredPosition = arrowPositions[pointingArrowPos].GetComponent <RectTransform>().anchoredPosition; //Visualmente colocada en la opción 1 optionSelected = -1; //No se ha seleccionada ninguna opción aún }
public void InitializeUI(int param0, float param1) //Esta función debe ser llamada por el TestManager cuando se inicia el sistema de turnos de la prueba { UIController.ChangeMode(UILayer.DancingTest); activatedTimer = true; timeBar.color = initialColor; numTotalBlocks = param0; numCompletedBlocks = 0; timeBarValue = 1; timeBar.fillAmount = timeBarValue; totalTime = param1; timeText.text = totalTime.ToString(); for (int i = 0; i < introductionTexts.Length; i++) { introductionTexts[i].color = new Color(1.0f, 1.0f, 1.0f, 0.0f); } finalText.color = new Color(1.0f, 1.0f, 1.0f, 0.0f); currentRemainingMistakes = 3; for (int i = 0; i < currentRemainingMistakes; i++) { unusedRemainingMistakes[i].color = new Color(1.0f, 1.0f, 1.0f, 1.0f); usedRemainingMistakes[i].color = new Color(1.0f, 1.0f, 1.0f, 0.0f); } }
public void InitializeUI() { UIController.ChangeMode(UILayer.DrinkingTest); leftNumDrinks = rightNumDrinks = 0; leftDrinkingBar.fillAmount = rightDrinkingBar.fillAmount = 0.0f; for (int i = 0; i < introductionTexts.Length; i++) { introductionTexts[i].color = new Color(1.0f, 1.0f, 1.0f, 0.0f); } finalText.color = new Color(1.0f, 1.0f, 1.0f, 0.0f); }