“Se obtiver a chave da unidade” Respostas de código

Detecção de chaves da unidade

if (Input.GetKeyDown(KeyCode.Space))
        {
            print("space key was pressed");
        }
RyanGar46

Se obtiver a chave da unidade

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        if (Input.GetKeyDown("space"))
        {
            print("space key was pressed");
        }
    }
}
Xenophobic Xenomorph

Debug.log (input.getKey)

void Update()
{
    //get the input
    var input = Input.inputString;

    //ignore null input to avoid unnecessary computation
    if (!string.IsNullOrEmpty(input))
    {
        switch(input)
        {
            case 'a': break;
            case 'b': break;
        }
    }
}
Agreeable Addax

Respostas semelhantes a “Se obtiver a chave da unidade”

Perguntas semelhantes a “Se obtiver a chave da unidade”

Mais respostas relacionadas para “Se obtiver a chave da unidade” em C#

Procure respostas de código populares por idioma

Procurar outros idiomas de código