Пример #1
0
    // Use this for initialization
    void Start()
    {
        if (PlayerPrefs.GetInt("Personagem") == 0 || PlayerPrefs.GetInt("Personagem") == 1)
        {
            btn_InicioJogo[1].enabled = true;
        }
        else
        {
            btn_InicioJogo[1].enabled = false;
        }


        img_Botoes[0].SetActive(false);
        img_Botoes[1].SetActive(false);
        novoJogoPanel.SetActive(false);
        audioSource = GetComponent <AudioSource>();
        canvas2.SetActive(false);
        load          = FindObjectOfType(typeof(Loading)) as Loading;
        gamepadCanvas = FindObjectOfType(typeof(GamepadCanvas)) as GamepadCanvas;
        // deixa os buttons invisiveis
        corAlpha   = img_MainMenu[0].image.color;
        corAlpha.a = 0;
        for (int i = 0; i < img_MainMenu.Length; i++)
        {
            img_MainMenu[i].image.color = corAlpha; // tira o alpha dos botoes
        }



        for (int i = 0; i < configTexto.Length; i++)
        {
            configTexto[i].color = corAlpha;
        }

        for (int i = 0; i < img_Qualidade.Length; i++)
        {
            img_Qualidade[i].color = corAlpha;
        }

        for (int i = 0; i < txt_Galeria.Length; i++)
        {
            txt_Galeria[i].color = corAlpha;
        }



        for (int i = 0; i < txt_IniciarGame.Length; i++)
        {
            txt_IniciarGame[i].color = corAlpha;
        }

        for (int i = 0; i < btn_InicioJogo.Length; i++)
        {
            btn_InicioJogo[i].image.color = corAlpha;
        }

        galeria.SetActive(false);
        mainMenu.SetActive(false);
        inicioJogo.SetActive(false);
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        audioSource = GetComponent <AudioSource>();

        gamepadCanvas = FindObjectOfType(typeof(GamepadCanvas)) as GamepadCanvas;
        txt_Aviso.SetActive(false);
        itensCarro     = FindObjectOfType(typeof(ItensCarro)) as ItensCarro;
        gameController = FindObjectOfType(typeof(GameController)) as GameController;
        liberarCorrida = FindObjectOfType(typeof(LiberarCorrida)) as LiberarCorrida;
        loading        = FindObjectOfType(typeof(Loading)) as Loading;
        mapaCorrida.SetActive(false);
        btnVolta.SetActive(false);
        mapinha.SetActive(false);

        for (int i = 0; i < liberarCorrida.ganhouCorrida.Length; i++)
        {
            if (liberarCorrida.ganhouCorrida[i])
            {
                img_Bolinhas[i].color = corBolinhas[0];
            }
            else
            {
                img_Bolinhas[i].color = corBolinhas[1];
            }
        }
    }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     gameController = FindObjectOfType(typeof(GameController)) as GameController;
     loading        = FindObjectOfType(typeof(Loading)) as Loading;
     gamepadCanvas  = FindObjectOfType(typeof(GamepadCanvas)) as GamepadCanvas;
     txt_NumeroLap.SetText(pontosLap.ToString());
     txt_NumeroVoltas.SetText("0");
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     liberarCorrida = FindObjectOfType(typeof(LiberarCorrida)) as LiberarCorrida;
     gameController = FindObjectOfType(typeof(GameController)) as GameController;
     gameController.setarPreferencias();
     gameController.changeState(GameState.GAMEPLAY);
     gamepadCanvas          = FindObjectOfType(typeof(GamepadCanvas)) as GamepadCanvas;
     gamepadCanvas.isCanvas = false;
     audioSource            = GetComponent <AudioSource>();
     loading = FindObjectOfType(typeof(Loading)) as Loading;
     canvas_Main.SetActive(false);
     canva_Config.SetActive(false);
     canva_Sair.SetActive(false);
     canvas_Pause.SetActive(true);
 }
Пример #5
0
 private void Start()
 {
     tutorialGeral  = FindObjectOfType(typeof(TutorialGeral)) as TutorialGeral;
     liberarCorrida = FindObjectOfType(typeof(LiberarCorrida)) as LiberarCorrida;
     gameController = FindObjectOfType(typeof(GameController)) as GameController;
     gamepadCanvas  = FindObjectOfType(typeof(GamepadCanvas)) as GamepadCanvas;
     loading        = FindObjectOfType(typeof(Loading)) as Loading;
     player         = FindObjectOfType(typeof(Player)) as Player;
     txt_Interagir.SetActive(false);
     cena = SceneManager.GetActiveScene();
     if (cena.name == "Cidade Rica")
     {
         for (int i = 0; i < canvasReciclagem.Length; i++)
         {
             canvasReciclagem[i].SetActive(false);
         }
     }
 }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        dialogo        = FindObjectOfType(typeof(Dialogo)) as Dialogo;
        gamepadCanvas  = FindObjectOfType(typeof(GamepadCanvas)) as GamepadCanvas;
        cena           = SceneManager.GetActiveScene();
        gameController = FindObjectOfType(typeof(GameController)) as GameController;

        // verifica se eu fiz o tutorial
        if (cena.name == "Mapa Exploracao")
        {
            if (PlayerPrefs.GetInt("TutorialExploracao") == 0) // caso eu não tenha feito o tutorial, o numero fica 0
            {
                contadorTexto = 1;
                canvasPlayer.SetActive(false); // desativa o canvas geral do player caso não tenha feito
                fezTutorialControle = false;
                canvasTutorial.SetActive(true);
                coletouContainer = false;
                gameController.changeState(GameState.INTERACAO);
            }
            else
            {
                fezTutorialContainer = true;
                canvasTutorial.SetActive(false);
                fezTutorialTempo    = true;
                fezTutorialControle = true;
            }
        }
        else if (cena.name == "Cidade Rica")
        {
            if (PlayerPrefs.GetInt("TutorialCidade") == 0)
            {
                tutorialCidade = false;
                telasCidade[0].SetActive(true);
                gameController.changeState(GameState.INTERACAO);
            }
            else
            {
                tutorialCidade = true;
                for (int i = 0; i < telasCidade.Length; i++)
                {
                    telasCidade[i].SetActive(false);
                }
                fezTutorialMapa     = true;
                fezTutorialReciclar = true;
            }
        }
        else if (cena.name == "Mapa da Ponte")
        {
            if (PlayerPrefs.GetInt("TutorialCorrida") == 0)
            {
                fezTutorialControle = true;
                for (int i = 0; i < telasCidade.Length; i++)
                {
                    telasCidade[i].SetActive(false);
                }
            }
            else
            {
                fezTutorialControle = false;
                for (int i = 0; i < telasCidade.Length; i++)
                {
                    telasCidade[i].SetActive(false);
                }
            }
        }

        if (cena.name == "Mapa Exploracao")
        {
            if (PlayerPrefs.GetInt("Idioma") == 0)
            {
                txt_explicacaoExploracao[0] = "Nesse modo é onde você irá coletar itens para criar o seu proprio carro.";
                txt_tutorialExplicacao.SetText(txt_explicacaoExploracao[0]);
                txt_explicacaoExploracao[1] = "Neste modo de jogo, seu objetivo é explorar a Ilha e procurar CONTAINERS que contenha luzes caindo sobre eles.";
                txt_explicacaoExploracao[2] = "Os lixos pegos nos CONTAINERS serão reciclados para poder fazer peças para o seu carro.";
                txt_explicacaoExploracao[3] = "Agora vamos começar o jogo.";
                txt_explicacaoExploracao[4] = "Os itens que você coletou estão armazenados dentro da maquina de reciclar no mapa da cidade.";
                txt_explicacaoExploracao[5] = "O tempo acabou, mas você ainda pode explorar a Ilha e verificar se ainda tem CONTAINERS com itens ou apenas conhecer melhor a ilha.";
                txt_explicacaoExploracao[6] = "Você pode ir para a cidade à qualquer momento.\nBasta você ir até um barco para poder ir até o outro mapa.";
            }
            else
            {
                txt_explicacaoExploracao[0] = "In this mode is where you will collect items to create your own car.";
                txt_tutorialExplicacao.SetText(txt_explicacaoExploracao[0]);
                txt_explicacaoExploracao[1] = "In this game mode, your goal is to explore the Island and look for CONTAINERS that contains lights falling on them.";
                txt_explicacaoExploracao[2] = "The garbage collected in CONTAINERS will be recycled to make parts for your car.";
                txt_explicacaoExploracao[3] = "Now let's start the game.";
                txt_explicacaoExploracao[4] = "The items you have collected are stored inside the recycling machine on the city map.";
                txt_explicacaoExploracao[5] = "The time is up but you can still explore the Island and check if you still have CONTAINERS with items or just get to know the island better.";
                txt_explicacaoExploracao[6] = "You can go to town at any time. \nJust go to a boat to be able to go to the other map.";
            }
        }
    }
Пример #7
0
    // Use this for initialization
    void Start()
    {
        gamepadCanvas  = FindObjectOfType(typeof(GamepadCanvas)) as GamepadCanvas;
        gameController = FindObjectOfType(typeof(GameController)) as GameController;
        mudarIdioma    = FindObjectOfType(typeof(MudarIdioma)) as MudarIdioma;

        QualitySettings.vSyncCount = 0;

        audioS = GetComponent <AudioSource>();

        int telaResolution = PlayerPrefs.GetInt("resolucaoTela");
        int graficConfig   = PlayerPrefs.GetInt("qualidadeGrafica");
        int detail         = PlayerPrefs.GetInt("nivelDetalhe");
        int fullScren      = PlayerPrefs.GetInt("telaCheia");
        int idioma         = PlayerPrefs.GetInt("Idioma");
        int antialising    = PlayerPrefs.GetInt("antialising");

        numIdioma = idioma;

        resolucaoTela    = telaResolution;
        qualidadeGrafica = graficConfig;
        nivelDetalhe     = detail;
        numAntiAliasing  = antialising;

        if (numIdioma == 0)
        {
            txt_Portugues.SetActive(true);
            txt_Ingles.SetActive(false);
        }
        else
        {
            txt_Portugues.SetActive(false);
            txt_Ingles.SetActive(true);
        }

        if (qualidadeGrafica == 3)
        {
            txt_Ultra.SetActive(true);
            txt_Alto.SetActive(false);
            txt_Medio.SetActive(false);
            txt_Baixo.SetActive(false);
        }
        else if (qualidadeGrafica == 2)
        {
            txt_Ultra.SetActive(false);
            txt_Alto.SetActive(true);
            txt_Medio.SetActive(false);
            txt_Baixo.SetActive(false);
        }
        else if (qualidadeGrafica == 1)
        {
            txt_Ultra.SetActive(false);
            txt_Alto.SetActive(false);
            txt_Medio.SetActive(true);
            txt_Baixo.SetActive(false);
        }
        else
        {
            txt_Ultra.SetActive(false);
            txt_Alto.SetActive(false);
            txt_Medio.SetActive(false);
            txt_Baixo.SetActive(true);
        }


        if (nivelDetalhe == 3)
        {
            txt_UltraDetalhes.SetActive(true);
            txt_AltoDetalhes.SetActive(false);
            txt_MedioDetalhes.SetActive(false);
            txt_BaixoDetalhes.SetActive(false);
        }
        else if (nivelDetalhe == 2)
        {
            txt_UltraDetalhes.SetActive(false);
            txt_AltoDetalhes.SetActive(true);
            txt_MedioDetalhes.SetActive(false);
            txt_BaixoDetalhes.SetActive(false);
        }
        else if (nivelDetalhe == 1)
        {
            txt_UltraDetalhes.SetActive(false);
            txt_AltoDetalhes.SetActive(false);
            txt_MedioDetalhes.SetActive(true);
            txt_BaixoDetalhes.SetActive(false);
        }
        else
        {
            txt_UltraDetalhes.SetActive(false);
            txt_AltoDetalhes.SetActive(false);
            txt_MedioDetalhes.SetActive(false);
            txt_BaixoDetalhes.SetActive(true);
        }


        if (resolucaoTela == 0)
        {
            txt_1920.SetActive(true);
            txt_1366.SetActive(false);
            txt_1280.SetActive(false);
        }
        else if (resolucaoTela == 1)
        {
            txt_1920.SetActive(false);
            txt_1366.SetActive(true);
            txt_1280.SetActive(false);
        }
        else
        {
            txt_1920.SetActive(false);
            txt_1366.SetActive(false);
            txt_1280.SetActive(true);
        }

        if (fullScren == 1)
        {
            telaCheia = true;
        }
        else
        {
            telaCheia = false;
        }

        if (telaCheia)
        {
            txt_LigadoTela.SetActive(true);
            txt_DesligadoTela.SetActive(false);
        }
        else
        {
            txt_LigadoTela.SetActive(false);
            txt_DesligadoTela.SetActive(true);
        }

        gameController.setarPreferencias();
    }