统一缩进为制表符
parent
e885c52f20
commit
9e23f0f9e2
@ -1,12 +1,12 @@
|
|||||||
extends Node3D
|
extends Node3D
|
||||||
|
|
||||||
func _input(event) -> void:
|
func _input(event) -> void:
|
||||||
if !event.is_action_type():
|
if !event.is_action_type():
|
||||||
return
|
return
|
||||||
for action_name in InputMap.get_actions():
|
for action_name in InputMap.get_actions():
|
||||||
if event.is_action_pressed(action_name):
|
if event.is_action_pressed(action_name):
|
||||||
SignalManager.input_action_pressed.emit(action_name)
|
SignalManager.input_action_pressed.emit(action_name)
|
||||||
elif event.is_action_released(action_name):
|
elif event.is_action_released(action_name):
|
||||||
SignalManager.input_action_released.emit(action_name)
|
SignalManager.input_action_released.emit(action_name)
|
||||||
var input_dir: Vector2 = Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
var input_dir: Vector2 = Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
||||||
SignalManager.input_action_move.emit(input_dir)
|
SignalManager.input_action_move.emit(input_dir)
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
func input_action_pressed(key: String):
|
func input_action_pressed(key: String):
|
||||||
match key:
|
match key:
|
||||||
"menu":
|
"menu":
|
||||||
Global.ui_mgr.pause_close("menu")
|
Global.ui_mgr.pause_close("menu")
|
||||||
Global.ui_mgr.open("hud")
|
Global.ui_mgr.open("hud")
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
extends Label
|
extends Label
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
set_text("%d FPS" % Engine.get_frames_per_second())
|
set_text("%d FPS" % Engine.get_frames_per_second())
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
func input_action_pressed(key: String):
|
func input_action_pressed(key: String):
|
||||||
match key:
|
match key:
|
||||||
"status":
|
"status":
|
||||||
Global.ui_mgr.pause_close("status")
|
Global.ui_mgr.pause_close("status")
|
||||||
Global.ui_mgr.open("hud")
|
Global.ui_mgr.open("hud")
|
||||||
|
|||||||
Loading…
Reference in New Issue