private void EstadoVerOpciones() { opciones.estiloGUIBotones.padding.top = 0; opciones.estiloGUIBotones.padding.bottom = 0; opciones.estiloGUIBotones.normal.background = null; //quitamos el dibujo del botón por defecto porque solo son las texturas lo que queremos mostrar GUILayout.BeginArea(espacioBotones); GUILayout.Label("Estilo botones"); opciones.nTexturasBotones = GUILayout.SelectionGrid(opciones.nTexturasBotones, opciones.listaTexturasBotones, opciones.listaTexturasBotones.Length / 2, GUILayout.MaxHeight(Screen.height * 2 / 10)); GUILayout.EndArea(); opciones.estiloGUIBotones.padding.top = 25; opciones.estiloGUIBotones.padding.bottom = 25; opciones.estiloGUIBotones.normal.background = opciones.estiloBotones; GUILayout.BeginArea(espacioVolumen); GUILayout.BeginVertical(); GUILayout.Label("Volumen"); PonerVolumen(GUILayout.HorizontalSlider(opciones.volumen, 0, 1)); GUILayout.EndVertical(); GUILayout.EndArea(); Rect espacioCartas = new Rect(Screen.width * 1 / 20, Screen.height * 2 / 5, Screen.width * 9 / 10, Screen.height * 2 / 5); GUILayout.BeginArea(espacioCartas); GUILayout.BeginHorizontal(); //GUI.skin.button = estiloGUISeleccionCartas; GUI.skin.button.normal.background = null; opciones.ponerMaterial(GUILayout.SelectionGrid(opciones.nReversoCartas, opciones.listaReversoCartas, opciones.listaReversoCartas.Length, GUILayout.MaxWidth(Screen.width * 9 / 10), GUILayout.MaxHeight(Screen.height * 2 / 5))); GUILayout.EndHorizontal(); GUILayout.EndArea(); GUI.skin.button.normal.background = opciones.estiloBotones; Rect espacioVolver = new Rect(Screen.width * 1 / 3, Screen.height * 8 / 10, Screen.width * 1 / 3, Screen.height * 2 / 10); GUILayout.BeginArea(espacioVolver); GUI.skin.button = estiloGUIBotones; if (CrearBoton("Inicio")) { //guardamos las opciones antes de volver opciones.estiloGUIBotones.normal.background = opciones.listaTexturasBotones[opciones.nTexturasBotones]; opciones.estiloBotones = opciones.listaTexturasBotones[opciones.nTexturasBotones]; opciones.GuardarOpciones(); estado = Estado.SeleccionarModo; //BoltLauncher.Shutdown(); } GUILayout.EndArea(); }
private void EstadoOpcionesJuego() { //fondo de los botones del menu opciones.estiloGUIBotones.padding.top = 0; opciones.estiloGUIBotones.padding.bottom = 0; opciones.estiloGUIBotones.normal.background = null; //quitamos el dibujo del botón por defecto porque solo son las texturas lo que queremos mostrar GUILayout.BeginArea(espacioBotones); GUILayout.Label("Estilo botones"); opciones.nTexturasBotones = GUILayout.SelectionGrid(opciones.nTexturasBotones, opciones.listaTexturasBotones, opciones.listaTexturasBotones.Length / 2, GUILayout.MaxHeight(Screen.height * 2 / 10)); GUILayout.EndArea(); opciones.estiloGUIBotones.padding.top = 25; opciones.estiloGUIBotones.padding.bottom = 25; opciones.estiloGUIBotones.normal.background = opciones.estiloBotones; //volumen GUILayout.BeginArea(espacioVolumen); GUILayout.BeginVertical(); GUILayout.Label("Volumen"); PonerVolumen(GUILayout.HorizontalSlider(opciones.volumen, 0, 1)); GUILayout.EndVertical(); GUILayout.EndArea(); //selección reverso cartas GUILayout.BeginArea(espacioCartas); GUILayout.BeginHorizontal(); GUI.skin.button.normal.background = null; opciones.ponerMaterial(GUILayout.SelectionGrid(opciones.nReversoCartas, opciones.listaReversoCartas, opciones.listaReversoCartas.Length, GUILayout.MaxWidth(Screen.width * 9 / 10), GUILayout.MaxHeight(Screen.height * 2 / 5))); foreach (GameObject objetoCarta in GameObject.FindGameObjectsWithTag("Carta")) { objetoCarta.GetComponent <Carta>().PonerReverso(); } GUI.skin.button.normal.background = opciones.estiloBotones; GUILayout.EndHorizontal(); GUILayout.EndArea(); //botón para salir GUILayout.BeginArea(espacioFinal); GUI.skin.button = estiloGUIBotones; if (CrearBoton("Salir del juego")) { //guardamos las opciones antes de volver opciones.estiloGUIBotones.normal.background = opciones.listaTexturasBotones[opciones.nTexturasBotones]; opciones.estiloBotones = opciones.listaTexturasBotones[opciones.nTexturasBotones]; opciones.GuardarOpciones(); estado = Estado.Confirmarsalir; //BoltLauncher.Shutdown(); } GUILayout.EndArea(); //botón para cerrar las opciones opciones.estiloGUIBotones.normal.background = null; //quitamos el dibujo del botón por defecto porque solo son las texturas lo que queremos mostrar if (GUI.Button(espacioBotonOpciones, botonCerrar)) { estado = Estado.Jugando; } opciones.estiloGUIBotones.normal.background = opciones.estiloBotones; //volvemos a poner el fondo }