Example #1
0
 public void SetInfoEspecial(InputPrefab input)
 {
     infoEspecial[input.GetNombreCategoria()] = input.GetValorCategoria();
 }
Example #2
0
    private void CrearPrefabs()
    {
        //if(listaPrefabs == null) return;

        //int idxColor = 0;

        foreach (var info in infoJugador.GetInfoObligatoria())
        {
            if (info.Key.ToUpper() == "NOMBRE")
            {
                nombreJugadorText.text = info.Value.ToString();
            }
            else
            {
                InputPrefab IPgo = Instantiate(prefabInputInfo, parentTransform).GetComponent <InputPrefab>();
                IPgo.gameObject.SetActive(true);
                IPgo.SetNombreCategoria(info.Key.ToString());
                IPgo.SetText(info.Key.ToString().ToUpper(), AppController.Idiomas.Español);
                IPgo.SetText(infoJugador.GetKeyInLaguage(info.Key.ToString(), AppController.Idiomas.Ingles), AppController.Idiomas.Ingles);
                IPgo.SetPlaceholder(info.Value.ToString());
                IPgo.HabilitarInput(false);
                inputsObligatorios.Add(IPgo);
                IPgo.SetKeyboardType(TouchScreenKeyboardType.Default);
                nombreActual = info.Value.ToString();
            }
            //IPgo.SetColor(coloresBotones[idxColor % coloresBotones.Count]);
            //idxColor++;
        }

        InputPrefabFecha IPGO = Instantiate(prefabInputFecha, parentTransform).GetComponent <InputPrefabFecha>();

        IPGO.gameObject.SetActive(true);
        IPGO.SetNombreCategoria("Fecha Nacimiento");
        IPGO.SetText("Fecha Nacimiento".ToUpper(), AppController.Idiomas.Español);
        IPGO.SetText("Date of Birth".ToUpper(), AppController.Idiomas.Ingles);
        IPGO.SetValorCategoria(infoJugador.GetFechaNac().ToShortDateString());
        IPGO.HabilitarInput(false);
        //listaPrefabs.Add(IPGO);
        inputFecha = IPGO;

        //IPGO.SetColor(coloresBotones[idxColor % coloresBotones.Count]);
        //idxColor++;
        //GO.transform.GetChild(0).GetComponent<Text>().text = "Fecha Nacimiento";
        //listaPrefabs.Add(GO);

        foreach (var info in infoJugador.GetInfoString())
        {
            InputPrefab IPgo = Instantiate(prefabInputInfo, parentTransform).GetComponent <InputPrefab>();
            IPgo.gameObject.SetActive(true);
            IPgo.SetNombreCategoria(info.Key.ToString());
            IPgo.SetText(info.Key.ToString().ToUpper(), AppController.Idiomas.Español);
            IPgo.SetText(infoJugador.GetKeyInLaguage(info.Key.ToString(), AppController.Idiomas.Ingles), AppController.Idiomas.Ingles);
            IPgo.SetPlaceholder(info.Value.ToString());
            IPgo.HabilitarInput(false);
            IPgo.SetKeyboardType(TouchScreenKeyboardType.Default);
            inputsString.Add(IPgo);

            //IPgo.SetColor(coloresBotones[idxColor % coloresBotones.Count]);
            //idxColor++;
        }

        foreach (var info in infoJugador.GetInfoInt())
        {
            InputPrefab IPgo = Instantiate(prefabInputInfo, parentTransform).GetComponent <InputPrefab>();
            IPgo.gameObject.SetActive(true);
            IPgo.SetNombreCategoria(info.Key.ToUpper());
            IPgo.SetText(info.Key.ToUpper(), AppController.Idiomas.Español);
            IPgo.SetText(infoJugador.GetKeyInLaguage(info.Key.ToString(), AppController.Idiomas.Ingles), AppController.Idiomas.Ingles);
            IPgo.SetPlaceholder(info.Value.ToString());
            IPgo.HabilitarInput(false);
            IPgo.SetKeyboardType(TouchScreenKeyboardType.NumberPad);
            inputsInt.Add(IPgo);

            if (IPgo.GetNombreCategoria() == "NUMERO CAMISETA")
            {
                numCamisetaActual = info.Value.ToString();
            }

            //IPgo.SetColor(coloresBotones[idxColor % coloresBotones.Count]);
            //idxColor++;
        }

        foreach (var info in infoJugador.GetInfoEspecial())
        {
            InputPrefabEspecial IPgo = Instantiate(prefabInputInfoEspecial, parentTransform).GetComponent <InputPrefabEspecial>();
            IPgo.gameObject.SetActive(true);
            IPgo.SetNombreCategoria(info.Key.ToString());
            IPgo.SetText(info.Key.ToString().ToUpper(), AppController.Idiomas.Español);
            IPgo.SetText(infoJugador.GetKeyInLaguage(info.Key.ToString(), AppController.Idiomas.Ingles), AppController.Idiomas.Ingles);
            IPgo.SetValor(infoJugador.GetSpecialValueInLanguage(info.Value.ToString(), AppController.Idiomas.Español), AppController.Idiomas.Español);
            IPgo.SetValor(infoJugador.GetSpecialValueInLanguage(info.Value.ToString(), AppController.Idiomas.Ingles), AppController.Idiomas.Ingles);
            IPgo.HabilitarInput(false);
            inputsEspecial.Add(IPgo);

            //IPgo.SetColor(coloresBotones[idxColor % coloresBotones.Count]);
            //idxColor++;
        }
    }
Example #3
0
 public void SetInfoInt(InputPrefab input)
 {
     infoInt[input.GetNombreCategoria()] = input.GetValorCategoria();
 }
Example #4
0
 public void SetInfoStringPlaceholder(InputPrefab input)
 {
     infoString[input.GetNombreCategoria()] = input.GetPlaceholder();
 }
Example #5
0
 public void SetInfoObligatoriaPlaceholder(InputPrefab input)
 {
     infoObligatoria[input.GetNombreCategoria()] = input.GetPlaceholder();
 }
Example #6
0
 public void SetInfoObligatoria(InputPrefab input)
 {
     infoObligatoria[input.GetNombreCategoria()] = input.GetValorCategoria();
 }
    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;
    }