// Use this for initialization
 public void Jugar()
 {
     Time.timeScale = 1;
     if (GameManager.Get() != null)
     {
         GameManager.Get().EnCreditos = false;
         GameManager.Get().pantallaCarga.SetActive(true);
         CargarNivel.Get().carga = 0;
     }
     SceneManager.LoadScene("Nivel 1");
     if (GameManager.Get() != null)
     {
         if (GameManager.Get().JuegoEmpezado)
         {
             Debug.Log("Entre");
             CargarNivel.Get().NumeroNivel   = 1;
             UI_Controller.Get().segundos    = 0;
             UI_Controller.Get().minutos     = 0;
             UI_Controller.Get().puntos      = 0;
             GameManager.Get().nivelActual   = 3;
             PlayerController.Get().velCaida = 0;
             PasarNivel();
         }
     }
 }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        if (GameManager.Get().EnCreditos)
        {
            alturaCero.SetActive(false);
            pantallaCarga.SetActive(false);
            PantallaAterrizaje.SetActive(false);
            botonPausa.SetActive(false);
            UI_Juego.SetActive(false);
            PantallaGameOver.SetActive(false);
        }

        if (CargarNivel.Get().prenderGameObjects)
        {
            UI_Juego.SetActive(true);
            alturaCero.SetActive(true);
            HabilitarMovimiento = true;
            CargarNivel.Get().prenderGameObjects = false;
            PlayerController.Get().puntos        = 0;
            PlayerController.Get().gasolina      = 3000;
        }
    }
예제 #3
0
 public void PasarNivel()
 {
     if (JuegoTerminado == false)
     {
         CargarNivel.Get().cargarNivel = true;
         tipoTextoPuntaje = 0;
         SetearJugador();
         PantallaAterrizaje.SetActive(false);
         botonPausa.SetActive(false);
         UI_Juego.SetActive(false);
         alturaCero.SetActive(false);
         pantallaCarga.SetActive(true);
         PantallaGameOver.SetActive(false);
         if (nivelActual < cantNiveles - 1)
         {
             nivelActual = nivelActual + 1;
         }
         else
         {
             nivelActual = 0;
         }
         camara.orthographicSize = 10;
     }
 }
예제 #4
0
 private void Awake()
 {
     instance = this;
 }