public void Actualizar() { GuardarObjetos(); UbicarPlataformas(); if (PlayerPrefs.HasKey(Constantes.PREFERENCIA_DIFICULTAD)) { TipoDificultad tipoDificultadActual = (TipoDificultad)PlayerPrefs.GetInt(Constantes.PREFERENCIA_DIFICULTAD); if (tipoDificultadActual == TipoDificultad.FACIL) { UbicarObjetos(Constantes.PREFAB_ENEMIGO, 2); } if (tipoDificultadActual == TipoDificultad.NORMAL) { UbicarObjetos(Constantes.PREFAB_ENEMIGO, 3); } if (tipoDificultadActual == TipoDificultad.DIFICIL) { UbicarObjetos(Constantes.PREFAB_ENEMIGO, 4); } } else { UbicarObjetos(Constantes.PREFAB_ENEMIGO, 4); } }
public Pelicula(string titulo, string pista, string imagen, TipoDificultad dificultad, GenerosCine genero) { Titulo = titulo ?? throw new ArgumentNullException(nameof(titulo)); Pista = pista ?? throw new ArgumentNullException(nameof(pista)); Imagen = imagen ?? throw new ArgumentNullException(nameof(imagen)); Dificultad = dificultad; Genero = genero; }
public void Establecer() { if (PlayerPrefs.HasKey(Constantes.PREFERENCIA_DIFICULTAD)) { TipoDificultad tipoDificultadActual = (TipoDificultad)PlayerPrefs.GetInt(Constantes.PREFERENCIA_DIFICULTAD); if (tipoDificultadActual == TipoDificultad.FACIL) { cantidadBandas = 3; } if (tipoDificultadActual == TipoDificultad.NORMAL) { cantidadBandas = Random.Range(4, 6); } if (tipoDificultadActual == TipoDificultad.DIFICIL) { cantidadBandas = 6; } } else { cantidadBandas = 3; } resistor = Resistencia.Generar(cantidadBandas); if (cantidadBandas == 3) { objBandaUno.GetComponent <ControladorBanda>().Establecer(null, false); objBandaDos.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[1], true); objBandaTres.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[2], true); objBandaCuatro.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[3], true); objBandaCinco.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[4], false); objBandaSeis.GetComponent <ControladorBanda>().Establecer(null, false); } if (cantidadBandas == 4) { objBandaUno.GetComponent <ControladorBanda>().Establecer(null, false); objBandaDos.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[1], true); objBandaTres.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[2], true); objBandaCuatro.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[3], true); objBandaCinco.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[4], true); objBandaSeis.GetComponent <ControladorBanda>().Establecer(null, false); } if (cantidadBandas == 5) { objBandaUno.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[1], true); objBandaDos.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[2], true); objBandaTres.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[3], true); objBandaCuatro.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[4], true); objBandaCinco.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[5], true); objBandaSeis.GetComponent <ControladorBanda>().Establecer(null, false); } if (cantidadBandas == 6) { objBandaUno.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[1], true); objBandaDos.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[2], true); objBandaTres.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[3], true); objBandaCuatro.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[4], true); objBandaCinco.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[5], true); objBandaSeis.GetComponent <ControladorBanda>().Establecer(resistor.Bandas[6], true); } objIndicador.transform.GetChild(0).gameObject.GetComponent <SpriteRenderer>().color = new Color(1f, 0f, 0f, 0.4f); }