Godot
[Godot] Using Timer Signal 타이머 시그널 사용하기
J-sean
2023. 9. 18. 20:34
반응형
타이머가 보내는 시그널을 받아보자.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
using Godot;
public partial class player : Sprite2D
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
Timer timer = GetNode<Timer>("Timer");
timer.Timeout += OnTimeout;
}
private void OnTimeout()
{
GD.Print("Timeout!!");
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
}
|
Timeout 시그널을 받는 스크립트를 작성한다.
※ 참고
반응형