ドキュメント

Unity Engine

Unity Engine

character

The character typed.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.IMGUIModule
public char character { get; set; }

Remarks

Used in EventType.KeyDown event. Note that EventType.KeyUp events might not contain a character, only Event.keyCode.
Additional Resources: Event.keyCode.

Examples

using UnityEngine;public class Example : MonoBehaviour{ void OnGUI() { Event e = Event.current; if (e.isKey) { Debug.Log("Detected character: " + e.character); } }}