コード例 #1
0
    public void OnMouseOver()
    {
        m_InfoOggetto.text = m_InfoString;


        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Esci"))
        {
            Application.Quit();
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Continua"))
        {
            m_MenuPrincipale.SetActive(false);
            m_GameManager.GetComponent <GameManager_HelpMe> ().ToggleGameRunning();
            OnMouseExit();
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("NuovaPartita"))
        {
            FileManager.salvaOpzioni();
            ThroughScenesParameters.setSceneToLoad(0);
            SceneManager.LoadScene("LoadingScreen", LoadSceneMode.Single);
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Aiutami"))
        {
            FileManager.salvaOpzioni();
            ThroughScenesParameters.setSceneToLoad(1);
            SceneManager.LoadScene("LoadingScreen", LoadSceneMode.Single);
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Opzioni"))
        {
            m_MenuOpzioni.SetActive(true);
            m_MenuPrincipale.SetActive(false);
            OnMouseExit();
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Controlli"))
        {
            m_MenuControlli.SetActive(true);
            m_MenuPrincipale.SetActive(false);
            OnMouseExit();
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Indietro"))
        {
            m_MenuPrincipale.SetActive(true);
            m_MenuOpzioni.SetActive(false);
            m_MenuControlli.SetActive(false);
            OnMouseExit();
        }
    }
コード例 #2
0
    IEnumerator LoadAsyncScene()
    {
        AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(ThroughScenesParameters.getSceneToLoad());

        asyncLoad.allowSceneActivation = false;

        while (!asyncLoad.isDone)
        {
            slider.value = asyncLoad.progress;
            if (asyncLoad.progress == 0.9f)
            {
                slider.value = 1f;
                asyncLoad.allowSceneActivation = true;
            }
            yield return(null);
        }
    }
コード例 #3
0
    void Start()
    {
        m_StatoCubo   = GetComponent <StatoCubo> ();
        m_Animatore   = GameObject.Find("Animazioni").GetComponent <Animatore>();
        m_GameRunning = false;
        SetCameraFreeEnabled(false);

        if (FileManager.isGameSavePresent() && FileManager.caricaDaFile())
        {
            Color attivato = new Color();
            ColorUtility.TryParseHtmlString("#00CAFFFF", out attivato);
            m_MenuPrincipalePrincipaleContinua.GetComponent <Text> ().color          = attivato;
            m_MenuPrincipalePrincipaleContinua.GetComponent <BoxCollider> ().enabled = true;
        }
        else
        {
            Color disattivato = new Color();
            ColorUtility.TryParseHtmlString("#00CAFF64", out disattivato);
            m_MenuPrincipalePrincipaleContinua.GetComponent <Text>().color           = disattivato;
            m_MenuPrincipalePrincipaleContinua.GetComponent <BoxCollider> ().enabled = false;

            GetComponent <SettingsManager> ().SetAlto();
            GetComponent <SettingsManager> ().SetVsyncOn();
            GetComponent <SettingsManager> ().SetSuoniOn();
        }

        if (ThroughScenesParameters.getSceneToLoad() == 0)
        {
            Color attivato = new Color();
            ColorUtility.TryParseHtmlString("#00CAFFFF", out attivato);
            m_MenuPrincipalePrincipaleContinua.GetComponent <Text> ().color          = attivato;
            m_MenuPrincipalePrincipaleContinua.GetComponent <BoxCollider> ().enabled = true;

            ResetCubo();
            ResetMosseEseguite();
            ResetTimer();

            m_MenuPrincipale.GetComponent <MenuPrincipale>().SetFirtsStart(false);
            m_MenuPrincipale.SetActive(false);
            m_GameRunning = true;
        }
    }
コード例 #4
0
    public void OnMouseOver()
    {
        m_InfoOggetto.text = m_InfoString;


        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Esci"))
        {
            if (!m_MenuPrincipale.GetComponent <MenuPrincipale>().GetFirtsStart())
            {
                FileManager.salvaSuFile();
            }
            Application.Quit();
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Continua"))
        {
            m_MenuPrincipale.GetComponent <MenuPrincipale>().SetFirtsStart(false);
            m_GameManager.GetComponent <GameManager>().SetCameraFreeEnabled(true);
            m_MenuPrincipale.SetActive(false);
            m_GameManager.GetComponent <GameManager> ().ToggleGameRunning();
            OnMouseExit();
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("NuovaPartita"))
        {
            Color attivato = new Color();
            ColorUtility.TryParseHtmlString("#00CAFFFF", out attivato);
            m_Continua.GetComponent <Text> ().color          = attivato;
            m_Continua.GetComponent <BoxCollider> ().enabled = true;

            m_GameManager.GetComponent <GameManager> ().ResetCubo();
            m_GameManager.GetComponent <GameManager> ().ResetMosseEseguite();
            m_GameManager.GetComponent <GameManager> ().ResetTimer();

            m_MenuPrincipale.GetComponent <MenuPrincipale>().SetFirtsStart(false);
            m_GameManager.GetComponent <GameManager>().SetCameraFreeEnabled(true);
            m_MenuPrincipale.SetActive(false);
            m_GameManager.GetComponent <GameManager> ().ToggleGameRunning();
            OnMouseExit();
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Aiutami"))
        {
            if (!m_MenuPrincipale.GetComponent <MenuPrincipale> ().GetFirtsStart())
            {
                FileManager.salvaSuFile();
            }
            ThroughScenesParameters.setSceneToLoad(1);
            SceneManager.LoadScene("LoadingScreen", LoadSceneMode.Single);
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Opzioni"))
        {
            m_MenuOpzioni.SetActive(true);
            m_MenuPrincipale.SetActive(false);
            OnMouseExit();
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Controlli"))
        {
            m_MenuControlli.SetActive(true);
            m_MenuPrincipale.SetActive(false);
            OnMouseExit();
        }

        if (Input.GetKeyDown(KeyCode.Mouse0) && name.Equals("Indietro"))
        {
            m_MenuPrincipale.SetActive(true);
            m_MenuOpzioni.SetActive(false);
            m_MenuControlli.SetActive(false);
            OnMouseExit();
        }
    }