Navigation
This page has not been translated yet. Showing the default language version.

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