Analyzer warnings occur in unexpected context Expected behavior UNT0014 should not triggers if T from GetComponent call refers to generic type parameter, which has Component constraint. Additional ...
In your example, the Enemy script would be a Unity Component, so it would not raise UNT0014. UNT0014 only applies to non-Unity Components. In the screenshot below I created a int i = GetComponent<int> ...
某些結果已隱藏,因為您可能無法存取這些結果。
顯示無法存取的結果