void Start() { if (gameObject.name == "Paleta de Hielo Objetivo") { objeto = Objeto.PaletaDeHielo; } else { objeto = Objeto.Chocolate; } gradient = new Gradient(); colorKey = new GradientColorKey[3]; colorKey[0].color = DecodificadorDeColor.decodificar(ColorObjeto.Azul); colorKey[0].time = 0.0f; colorKey[1].color = DecodificadorDeColor.decodificar(ColorObjeto.Blanco); colorKey[1].time = 0.5f; colorKey[2].color = DecodificadorDeColor.decodificar(ColorObjeto.Rosa); colorKey[2].time = 1.0f; alphaKey = new GradientAlphaKey[3]; alphaKey[0].alpha = 1.0f; alphaKey[0].time = 0.0f; alphaKey[1].alpha = 1.0f; alphaKey[1].time = 0.5f; alphaKey[2].alpha = 1.0f; alphaKey[2].time = 1.0f; gradient.SetKeys(colorKey, alphaKey); }
void SeleccionaObjetos() { MotorInferencia.DeterminarObjetivo(); objetoObjetivo = MotorInferencia.Objetivo(); colorObjetivo = MotorInferencia.Color(); tieneColores = MotorInferencia.TieneColores(); nivel = MotorInferencia.nivel; dificultad = MotorInferencia.dificultad; nivelLabel.GetComponent <Text>().text = string.Format("N: {0}, D: {1}", nivel + 1, dificultad + 1); switch (objetoObjetivo) { case Objeto.Paleta: if (tieneColores) { objetivoPaleta.GetComponent <Renderer>().material.color = DecodificadorDeColor.decodificar(colorObjetivo); } Destroy(objetivoPaletaDeHielo); Destroy(objetivoChocolate); break; case Objeto.PaletaDeHielo: if (tieneColores) { objetivoPaletaDeHielo.GetComponent <Renderer>().materials[1].color = DecodificadorDeColor.decodificar(colorObjetivo); } Destroy(objetivoPaleta); Destroy(objetivoChocolate); break; default: if (tieneColores) { objetivoChocolate.GetComponent <Renderer>().material.color = DecodificadorDeColor.decodificar(colorObjetivo); } Destroy(objetivoPaleta); Destroy(objetivoPaletaDeHielo); break; } switch (MotorInferencia.nivel) { case 0: audioSource.clip = AudioN1; Destroy(Canasta); break; case 1: audioSource.clip = AudioN2; Destroy(Canasta); break; default: audioSource.clip = AudioN3; break; } audioSource.Play(); }
//private int dificultad; // Start is called before the first frame update void Start() { toquesBuenos = 0; toquesMalos = 0; toques = 0; clic = false; clicAnterior = false; //Posicionamiento de objetos transform.position = Random.insideUnitSphere * 5; System.Enum.TryParse <Objeto>(gameObject.name, out objeto); objetivo = MotorInferencia.Objetivo(); colorObjetivo = DecodificadorDeColor.decodificar(MotorInferencia.Color()); CantidadObjetos = MotorInferencia.CantidadObjetivos(); TieneColores = MotorInferencia.TieneColores(); SeMueven = MotorInferencia.SeMueven(); nivel = MotorInferencia.nivel; }
// Start is called before the first frame update void Start() { //ColorObjeto colorObjeto = (ColorObjeto) Random.Range(0, 3); Objeto objeto; //Debug.Log(gameObject.name); System.Enum.TryParse <Objeto>(gameObject.name, out objeto); ColorObjeto colorObjeto = MotorInferencia.IteradorDeColores.Siguiente(objeto); TieneColores = MotorInferencia.TieneColores(); if (objeto == Objeto.PaletaDeHielo) { GetComponent <Renderer>().materials[1].color = DecodificadorDeColor.decodificar(colorObjeto); } else { GetComponent <Renderer>().material.color = DecodificadorDeColor.decodificar(colorObjeto); } }