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

PropertyValue
IDVSC0023
CategoryMaintainability
SeverityWarning
Runtime Version3.1.0 ~ latest
Compiler Version1.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
VSC0023: Use the `nameof` operator instead of directly specifying the method name in SendCustomEvent / Udon Analyzer / Natsuneko Laboratory Docs