[UxmlElement("TestCustomControl")]
public partial class TestCustomControl : VisualElement
{
[UxmlAttribute]
public string MyString { get; set; } = MYSTRING_DEFAULT_VALUE;
[UxmlAttribute]
public int MyInt { get; set; } = MYINT_DEFAULT_VALUE;
// ... etc
and my code-generated class looks like this:
public partial class TestCustomControl : VisualElement
{
[UxmlAttribute]
public string PROPERTY_I_AM_LOOKING_FOR { get; set; } = ""I am looking for this"";
// ... etc
If I put a breakpoint in my TestCustomControl() constuctor I can see the property defined in the code-generated class exists, for example:
The ‘MyInt’ and ‘MyString’ properties defined in my custom control are there BUT the ‘PROPERTY_I_AM_LOOKING_FOR’ property from the code-generated class is Not there.
I am accessing the parent property in my custom property drawer by doing:
Generated a new dll and placed it in my Unity project. Unfortunately, the code-generated property with [UxmlAttribute] attribute still does not appear as a serialized property in the custom property drawer boxedValues. I also tried referencing the other Unity.SourceGenerators dlls as in:
without success. The [UxmlAttribute] property in my code-generation class still does not appear as a boxed value in the custom property drawer.
What else do you suggest me to try?
Thank you for the follow-up .
Unfortunately, no, the [UxmlAttribute] property in the code-gen class does not appear in UIBuilder inspector after stopping using the custom property drawer.
That sounds like it’s not running the source generator on the attributes you generated. It could be a bug on our end, this is not something we have tested. Please file a bug report so we can look into it