Buttons Using UnityEngine.UIElements Instead of UnityEngine.UI in C# Gen

Just ran across this issue today.

After adding serialized buttons to my TypeScript file, the generated C# is using UnityEngine.UIElements instead of UnityEngine.UI.

Looking at the Needle Engine TS implementation of Button, I assume the intent is to continue utilizing the UnityEngine.UI implementation. Is this correct?

Where do I make sure the right dependencies are being utilized?

Any help would be appreciated. Thanks in advance. :+1:

btwā€¦ loving Needle Engine.





Original Post on Discord

by user 384802274322546689

Hi :wave:
You can add a ā€œ@typeā€ annotation above:

// @type UnityEngine.UI.Button
@serializable(Button)
public playButton: Button;

to ensure a specific namespace is used

Perfect! Thank you!

by user 384802274322546689