22-05-2013, 04:46 PM
Ragazzi ho trovato questa soluzione e sembra funzionare se non che adesso non funzionano più i pulsanti
Codice:
using UnityEngine;
using System.Collections;
public class bootsk : MonoBehaviour
{
public GUIStyle style;
public GUIStyle style1;
public GUIStyle style2;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
}
//Zona Grafica
void OnGUI()
{
if (Screen.width/2 >= 960)
{
GUI.Button(new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Premi qui per entrare nel gioco",style);
if(GUI.Button(new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Premi qui per tornare al desktop",style1))
{
Application.Quit();
}
GUI.Label (new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Questo è un gioco: non bisogna ripetere questo nella vita reale",style2);
}
else if (Screen.width/2 >= 800)
{
GUI.Label (new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Questo è un gioco: non bisogna ripetere questo nella vita reale",style2);
GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 + 150, 100, 50),"Premi qui per entrare nel gioco",style);
if(GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 - 150, 100, 50),"Premi qui per tornare al desktop",style1))
{
Application.Quit();
}
}
}
}
Qualucno sa perchè, ho controllato, gli if non dovrebbero andare in conflitto, se qualcuno ha qualche idea non esiti anche se sbagliata potrebbe ispirare una soluzione a qualcun altro!
Codice:
using UnityEngine;
using System.Collections;
public class bootsk : MonoBehaviour
{
public GUIStyle style;
public GUIStyle style1;
public GUIStyle style2;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
}
//Zona Grafica
void OnGUI()
{
if (Screen.width/2 >= 960)
{
GUI.Button(new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Premi qui per entrare nel gioco",style);
if(GUI.Button(new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Premi qui per tornare al desktop",style1))
{
Application.Quit();
}
GUI.Label (new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Questo è un gioco: non bisogna ripetere questo nella vita reale",style2);
}
else if (Screen.width/2 >= 800)
{
GUI.Label (new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Questo è un gioco: non bisogna ripetere questo nella vita reale",style2);
GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 + 150, 100, 50),"Premi qui per entrare nel gioco",style);
if(GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 - 150, 100, 50),"Premi qui per tornare al desktop",style1))
{
Application.Quit();
}
}
}
}
Qualucno sa perchè, ho controllato, gli if non dovrebbero andare in conflitto, se qualcuno ha qualche idea non esiti anche se sbagliata potrebbe ispirare una soluzione a qualcun altro!