This topic is not available in your language. Therefore, the original version (ja-jp) is displayed.

VSC0019: Duplicate FieldChangeCallbackAttribute targets may be cause unexpected behaviour

PropertyValue
IDVSC0019
CategoryUnexpected
SeverityWarning
Runtime Version3.1.0 ~ latest
Compiler Version1.0.0 ~ latest

Duplicate FieldChangeCallbackAttribute targets may be cause unexpected behaviour

Example

Code with Diagnostic

using UdonSharp;
 
class TestBehaviour0 : UdonSharpBehaviour
{
    [FieldChangeCallback(nameof(SomeProperty))]
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    private string _str1;
 
    [FieldChangeCallback("SomeProperty")]
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    private string _str2;
 
    public string SomeProperty { get; set; }
 
}

Code with Fix

// NOT YET PROVIDED
VSC0019: Duplicate FieldChangeCallbackAttribute targets may be cause unexpected behaviour / Udon Analyzer / Natsuneko Laboratory Docs