반응형

사용자 시그널을 받아 보자.

 

Node2D를 생성하고 스크립트(Receiver.cs)를 붙여준다.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using Godot;
 
public partial class Receiver : Node2D
{
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        Sender sender = GetNode<Sender>("Sprite2D");
        // "Sprite2D" is the name of the Node in the scene.
        sender.Accept += OnAccept;
    }
 
    private void OnAccept()
    {
        GD.Print("Accept!!");
    }
 
    // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void _Process(double delta)
    {
    }
}
 

 

 

Accept 시그널(엔터키)을 받는 스크립트를 작성한다.

 

Sprite2D를 생성하고 스크립트(Sender.cs)를 붙여준다.

 

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 Sender : Sprite2D
{
    [Signal]
    public delegate void AcceptEventHandler();    
 
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
    }
 
    // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void _Process(double delta)
    {
        if (Input.IsActionJustPressed("ui_accept"))
        {
            EmitSignal(SignalName.Accept);
        }
    }
}
 

 

 

Accept 시그널(엔터키)을 보내는 스크립트를 작성한다.

시그널 delegate 이름은 [시그널 이름 + EventHandler] 형식으로 작성한다. 위 코드의 경우 시그널 이름이 Accept이고 delegate 이름은 AcceptEventHandler이다.

 

 

씬을 저장하고 게임을 실행하면 엔터키가 눌릴 때마다 Output 창에 Accept!! 메세지가 출력된다.

 

※ 참고

Using signals

C# signals

 

반응형
Posted by J-sean
:
반응형

유저 모드 애플리케이션이 충돌한 후 덤프를 수집하고 저장하도록 해 보자.

 

위와 같이 레지스트리 값을 작성한다. DumpType 만 작성하고 나머지는 기본값을 사용했다.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps

Value Description Type Default value
DumpFolder 덤프 파일을 저장할 경로 REG_EXPAND_SZ %LOCALAPPDATA%\CrashDumps
DumpCount 폴더의 최대 덤프 파일 수 REG_DWORD 10
DumpType 다음 덤프 유형 중 하나
0: 사용자 지정 덤프
1: 미니 덤프
2: 전체 덤프
REG_DWORD 1
CustomDumpFlags 사용할 사용자 지정 덤프 옵션. 이 값은 DumpType 이 0으로 설정된 경우에만 사용. REG_DWORD  

 

애플리케이션이 충돌하면 덤프 파일이 생성된다.

 

※ 참고

Collecting User-mode dumps

 

반응형
Posted by J-sean
: