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); } }}