This topic is not available in your language. Therefore, the original version (ja-jp) is displayed.
VSC0023: Use the `nameof` operator instead of directly specifying the method name in SendCustomEvent
| Property | Value |
|---|---|
| ID | VSC0023 |
| Category | Maintainability |
| Severity | Warning |
| Runtime Version | 3.1.0 ~ latest |
| Compiler Version | 1.0.0 ~ latest |
Use the `nameof` operator instead of directly specifying the method name in SendCustomEvent
Example
Code with Diagnostic
using UdonSharp;
class TestBehaviour0 : UdonSharpBehaviour
{
private TestBehaviour0 _behaviour;
public void TestMethod()
{
_behaviour.SendCustomEvent("TestMethod");
~~~~~~~~~~~~
SendCustomEvent("TestMethod");
~~~~~~~~~~~~
}
}Code with Fix
// NOT YET PROVIDED