コード例 #1
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.R))
     {
         CursorLockControl.UnlockCursor();
         MenuCanvasScript.Inicio();
     }
 }
コード例 #2
0
    void Update()
    {
        placar = LolaScript.pontos;
        placarVal.GetComponent <Text>().text = placar.ToString();

        if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.P))
        {
            if (!jogoPausado)
            {
                CursorLockControl.UnlockCursor();
                Pausar();
            }
            else
            {
                CursorLockControl.LockCursor();
                Continuar();
            }
        }

        int tempoCont = Mathf.FloorToInt(Time.time) - tempoIni;

        if (Mathf.FloorToInt(Time.time) - tempoIni >= 6)//6 segundos da animação inicial da camera
        {
            tempoVal.GetComponent <Text>().text = (tempoMax - tempoCont).ToString();
        }

        if (tempoMax - tempoCont <= 0)
        {
            if (placar >= 150)
            {
                Vitoria();
            }

            FimDeJogo();
        }
    }