Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
GD0201: 대리자의 이름은 'EventHandler'로 끝나야 합니다.
규칙 ID |
GD0201 |
카테고리 |
사용례 |
수정 내용이 중단되거나 중단되지 않음 |
굽기 |
기본적으로 활성화됨 |
es |
원인
[Signal] 속성으로 주석이 달린 대리자 이름이 'EventHandler'로 끝나지 않습니다.
설명
Godot 소스 생성기는 'EventHandler' 접미사가 제거된 대리자 이름을 사용하여 C# 이벤트를 생성합니다. 이벤트에 사용되는 대리자 이름에 'EventHandler' 접미사를 추가하는 것은 `.NET 명명 규칙 <https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#names-of-common-types>`_입니다.
대리자에 접미사를 사용하면 생성된 이벤트에서 이름 충돌을 방지하면서 접미사 없이 이름을 사용할 수 있습니다.
// This delegate is invalid since the name doesn't end with 'EventHandler'.
[Signal]
public void InvalidSignal();
// This delegate is valid since the name ends with 'EventHandler'.
[Signal]
public void ValidSignalEventHandler();
시그널를 선언하고 사용하는 방법에 대한 자세한 내용은 C# 시그널 문서를 살펴보세요.
독립적으로 존재해야 하는 것
이 규칙 위반을 수정하려면 대리자 이름 끝에 'EventHandler'를 추가하세요.
경고를 억제해야 하는 경우
이 규칙에서 경고를 표시하지 마세요. 접미사가 없는 시그널 대리인은 소스 생성기에서 무시되므로 시그널는 등록되지 않습니다.