본문 바로가기
개발/C#

유니티 C# 키보드 입력 Keyboard input 간단 사용법

by SPNK 2022. 6. 20.
반응형
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Example : MonoBehaviour
{
    void Update()
    {
        if(Input.GetKey(KeyCode.A))
        {
            Debug.Log("Press A");
        }

        if (Input.GetKey(KeyCode.UpArrow))
        {
            Debug.Log("Press UpArrow");
        }

        if (Input.GetKey(KeyCode.Space))
        {
            Debug.Log("Press Space");
        }
    }
}
반응형

댓글