public void SetPanel() { CanvasController.instance.retrocesoPausado = false; CanvasController.instance.overlayPanel.SetNombrePanel("NUEVO JUGADOR", AppController.Idiomas.Español); CanvasController.instance.overlayPanel.SetNombrePanel("NEW PLAYER", AppController.Idiomas.Ingles); if (inputsObligatorios != null) { foreach (var input in inputsObligatorios) { input.ResetValor(); } } if (inputsString != null) { foreach (var input in inputsString) { input.ResetValor(); } } if (inputsInt != null) { foreach (var input in inputsInt) { input.ResetValor(); } } if (inputsEspecial != null) { foreach (var input in inputsEspecial) { input.ResetValor(); } } if (inputFecha != null) { inputFecha.ResetValor(); } pathImagenJugador = null; imagenJugador.sprite = defaultSpriteJugador; if (prefabHeight == 0) { prefabHeight = prefabInputInfo.GetComponent <RectTransform>().rect.height; } cantMinima = (int)(scrollRect.GetComponent <RectTransform>().rect.height / (prefabHeight + parentTransform.GetComponent <VerticalLayoutGroup>().spacing + parentTransform.GetComponent <VerticalLayoutGroup>().padding.top)); }
private void SetInputs() { infoJugador = new InfoJugador(); inputsString = new List <InputPrefab>(); inputsInt = new List <InputPrefab>(); inputsEspecial = new List <InputPrefab>(); inputsObligatorios = new List <InputPrefab>(); //int idxColor = 0; foreach (var info in infoJugador.GetInfoObligatoria()) { GameObject go = Instantiate(prefabInputInfo, parentTransform); go.gameObject.SetActive(true); InputPrefab IPgo = go.GetComponent <InputPrefab>(); IPgo.SetNombreCategoria(info.Key.ToUpper()); IPgo.SetText(info.Key, AppController.Idiomas.Español); IPgo.SetText(infoJugador.GetKeyInLaguage(info.Key, AppController.Idiomas.Ingles), AppController.Idiomas.Ingles); IPgo.SetCampoObligatorio(true); IPgo.SetKeyboardType(TouchScreenKeyboardType.Default); inputsObligatorios.Add(IPgo); //IPgo.SetColor(coloresBotones[idxColor % coloresBotones.Count]); //idxColor++; } GameObject GO = Instantiate(prefabInputFecha, parentTransform); GO.SetActive(true); inputFecha = GO.GetComponent <InputPrefabFecha>(); inputFecha.SetCampoObligatorio(true); inputFecha.SetNombreCategoria("Fecha Nacimiento".ToUpper()); inputFecha.SetText("Fecha Nacimiento".ToUpper(), AppController.Idiomas.Español); inputFecha.SetText("Date of birth".ToUpper(), AppController.Idiomas.Ingles); inputFecha.ResetValor(); //inputFecha.SetColor(coloresBotones[idxColor % coloresBotones.Count]); //idxColor++; foreach (var info in infoJugador.GetInfoString()) { GameObject go = Instantiate(prefabInputInfo, parentTransform); go.SetActive(true); InputPrefab IPgo = go.GetComponent <InputPrefab>(); IPgo.SetNombreCategoria(info.Key.ToUpper()); IPgo.SetText(info.Key, AppController.Idiomas.Español); IPgo.SetText(infoJugador.GetKeyInLaguage(info.Key, AppController.Idiomas.Ingles), AppController.Idiomas.Ingles); IPgo.SetKeyboardType(TouchScreenKeyboardType.Default); inputsString.Add(IPgo); //IPgo.SetColor(coloresBotones[idxColor % coloresBotones.Count]); //idxColor++; } foreach (var info in infoJugador.GetInfoInt()) { Debug.Log("INFO INT"); GameObject go = Instantiate(prefabInputInfo, parentTransform); go.SetActive(true); InputPrefab IPgo = go.GetComponent <InputPrefab>(); IPgo.SetNombreCategoria(info.Key.ToUpper()); IPgo.SetText(info.Key, AppController.Idiomas.Español); IPgo.SetText(infoJugador.GetKeyInLaguage(info.Key, AppController.Idiomas.Ingles), AppController.Idiomas.Ingles); IPgo.SetKeyboardType(TouchScreenKeyboardType.NumberPad); inputsInt.Add(IPgo); //IPgo.SetColor(coloresBotones[idxColor % coloresBotones.Count]); //idxColor++; } foreach (var info in infoJugador.GetInfoEspecial()) { GameObject go = Instantiate(prefabInputInfoEspecial, parentTransform); go.SetActive(true); InputPrefabEspecial IPgo = go.GetComponent <InputPrefabEspecial>(); IPgo.SetNombreCategoria(info.Key.ToUpper()); IPgo.SetText(info.Key, AppController.Idiomas.Español); IPgo.SetText(infoJugador.GetKeyInLaguage(info.Key, AppController.Idiomas.Ingles), AppController.Idiomas.Ingles); inputsEspecial.Add(IPgo); //IPgo.SetColor(coloresBotones[idxColor % coloresBotones.Count]); //idxColor++; } pathImagenJugador = null; imagenJugador.sprite = defaultSpriteJugador; }