“Onkeypressed Unity” Kode Jawaban

Deteksi Kunci Persatuan

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

Jika dapatkan Key Down Unity

using UnityEngine;
using System.Collections;

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

Onkeypressed Unity

public void Update()
 {
      if (Input.GetKeyUp(KeyCode.X))
     {
        //do stuff
     }
 }
Blue Bee

tekan tombol run code Unity C#

if(Input.GetKey(KeyCode.space))
	{
  		print("Space key was pressed")
	}
Embarrassed Earthworm

Jawaban yang mirip dengan “Onkeypressed Unity”

Pertanyaan yang mirip dengan “Onkeypressed Unity”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya