mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 17:28:58 +00:00
add missing brackets in c sharp code
This commit is contained in:
@@ -32,7 +32,9 @@ Handling the notification is done as follows (on any node):
|
||||
public override void _Notification(int what)
|
||||
{
|
||||
if (what == NotificationWMCloseRequest)
|
||||
{
|
||||
GetTree().Quit(); // default behavior
|
||||
}
|
||||
}
|
||||
|
||||
It is important to note that by default, Godot apps have the built-in
|
||||
|
||||
@@ -27,8 +27,12 @@ Here is a quick example, closing your game if the escape key is hit:
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
if (@event is InputEventKey eventKey)
|
||||
{
|
||||
if (eventKey.Pressed && eventKey.Keycode == Key.Escape)
|
||||
{
|
||||
GetTree().Quit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
However, it is cleaner and more flexible to use the provided :ref:`InputMap <class_InputMap>` feature,
|
||||
|
||||
Reference in New Issue
Block a user