Exemplo n.º 1
0
 public void Probar_boton()
 {
     Guardado.Grabar();
     Application.LoadLevel("Menu");
 }
Exemplo n.º 2
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))          //En el caso de salirnos guardamos los estados de las barras
        {
            Guardado.Grabar();
            Application.LoadLevel("Menu");
        }

        if (cont_comida <= 0)
        {
            if (ControlTarget.nChuletas > 0)
            {
                cont_comida = 5;
                if (cont == 1)
                {
                    ControlTarget.nChuletas--;
                }
                else
                {
                    cont++;
                }
            }

            t_comida = false;
            target_comida.gameObject.SetActive(false);
            target_comida.localScale = new Vector3(0.05f, 0.05f, 0.05f);
        }
        if (cont_bebida <= 0)
        {
            cont_bebida = 5;
            t_bebida    = false;
            target_bebida.gameObject.SetActive(false);
            target_bebida.localScale = new Vector3(0.078f, 0.02001f, 0.078f);
        }

        if (!t_comida && !t_bebida && com_beb)
        {
            ani.Play("Li_Run");
            com_beb = false;
        }
        if (!t_comida && !t_bebida && !ControlTarget.presencia_numeros)
        {
            Libre();
        }
        else if (t_comida && ControlTarget.nChuletas > 0)
        {
            if (!target_comida.gameObject.activeSelf)
            {
                target_comida.gameObject.SetActive(true);
            }
            Comer();
        }
        else if (t_bebida)
        {
            if (!target_bebida.gameObject.activeSelf)
            {
                target_bebida.gameObject.SetActive(true);
            }
            Beber();
        }
    }