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...
GD0202: 시그널의 대리인 서명 매개변수가 지원되지 않습니다.
규칙 ID |
GD0202 |
카테고리 |
사용례 |
수정 내용이 중단되거나 중단되지 않음 |
속보 - 매개변수 유형이 변경된 경우 비계속 - |
기본적으로 활성화됨 |
es |
원인
An unsupported type is specified for a parameter of a delegate annotated with
the [Signal] attribute when a
Variant-compatible type is expected.
설명
모든 시그널 매개변수는 변형 호환 가능해야 시그널를 내보내고 콜백을 호출할 때 마샬링될 수 있습니다.
class SomeType { }
// SomeType is not a valid parameter type because it doesn't derive from GodotObject,
// so it's not compatible with Variant.
public void InvalidSignalEventHandler(SomeType someType);
// System.Int32 is a valid type because it's compatible with Variant.
public void ValidSignalEventHandler(int someInt);
시그널를 선언하고 사용하는 방법에 대한 자세한 내용은 C# 시그널 문서를 살펴보세요.
독립적으로 존재해야 하는 것
이 규칙 위반 문제를 해결하려면 매개변수 유형을 Variant 호환 가능으로 변경하거나 위임에서 [Signal] 속성을 제거하세요. 속성을 제거하면 시그널가 등록되지 않음을 의미합니다.
팁
시그널가 Godot와 상호 작용할 필요가 없다면 `C# 이벤트 <https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/>`_를 직접 사용하는 것을 고려해 보세요. 순수 C# 이벤트를 사용하면 해당 매개변수에 대해 모든 C# 유형을 사용할 수 있습니다.
경고를 억제해야 하는 경우
이 규칙에서 경고를 표시하지 마세요. 마샬링할 수 없는 매개변수가 있는 시그널 대리자는 시그널를 내보내거나 콜백을 호출할 때 런타임 오류가 발생합니다.