コード例 #1
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();
        }
    }
コード例 #2
0
 //Do this when the mouse is clicked over the selectable object this script is attached to.
 public void OnPointerDown(PointerEventData eventData)
 {
     CursorLockControl.LockCursor();
     MenuCanvasScript.Jogar();
 }
コード例 #3
0
 //Do this when the mouse is clicked over the selectable object this script is attached to.
 public void OnPointerDown(PointerEventData eventData)
 {
     CursorLockControl.LockCursor();
     GameCanvasScript.Continuar();
 }