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...
GD0106: 내보낸 속성은 명시적 인터페이스 구현입니다.
규칙 ID |
GD0106 |
카테고리 |
사용례 |
수정 내용이 중단되거나 중단되지 않음 |
굽기 |
기본적으로 활성화됨 |
es |
원인
명시적인 인터페이스 속성 구현에는 [Export] 속성으로 주석이 추가됩니다. 인터페이스를 명시적으로 구현하는 속성은 내보낼 수 없습니다.
설명
Godot는 명시적인 인터페이스 속성 구현 내보내기를 허용하지 않습니다. 인터페이스 멤버가 명시적으로 구현되면 해당 멤버는 숨겨지고 형식이 먼저 인터페이스로 변환되지 않으면 소비자가 해당 멤버에 액세스할 수 없습니다. 명시적으로 구현된 멤버는 해당 형식의 다른 멤버와 동일한 이름을 공유할 수도 있으므로 내보낸 다른 멤버와 이름 지정 충돌이 발생할 수 있습니다.
public interface MyInterface
{
public int MyProperty { get; set; }
}
public class MyNode1 : Node, MyInterface
{
// The property can be exported because it implements the interface implicitly.
[Export]
public int MyProperty { get; set; }
}
public class MyNode2 : Node, MyInterface
{
// The property can't be exported because it implements the interface explicitly.
[Export]
int MyInterface.MyProperty { get; set; }
}
독립적으로 존재해야 하는 것
이 규칙 위반을 수정하려면 인터페이스를 암시적으로 구현하거나 [Export] 속성을 제거하세요.
경고를 억제해야 하는 경우
이 규칙에서 경고를 표시하지 마세요. 명시적인 인터페이스 속성 구현은 내보낼 수 없으므로 Godot에서 무시되어 런타임 오류가 발생합니다.