Unity3D Forum » UI Toolkit
48 FOLLOWERS
Welcome to the Unity Forums! This is a place to discuss UI Toolkit, discuss its updates, share your UI Toolkit projects, and learn what's new in the UI Toolkit documentation. Unity3D Forum is for democratize game development, solve hard problems, and enable customer success.
Unity3D Forum » UI Toolkit
26m ago
Hi,
I need some help with binding nested lists of data to a custom editor. I have tried to simplify the problem here as much as possible so it's easier to understand.
The data consists of a scriptable object that contains info about a list of characters. When I double click this scriptable object I open an editor window.
Code (CSharp):
public class CharactersDataSO : ScriptableObject
{
public List<CharacterInfo> m_Characters;
}
Each character has a name and a list of abilities....
Need help with binding ..read more
Unity3D Forum » UI Toolkit
10h ago
I was trying to make some transition animation effect which triggers when the Close button pressed.
So I need the UI and its child elements ignore all events while the animation is playing.(So that user won't press other buttons and causes undesired result.)
I tried VisualElement.SetEnabled(false), but this changes the UI opacity. Also tried pickingMode, but that doesn't apply to its children (e.g. other buttons);
Any Suggestions ..read more
Unity3D Forum » UI Toolkit
2d ago
I am extending VisualElement and need to know when the element is removed from the hierarchy, so that I can automatically remove associated objects. But how ..read more
Unity3D Forum » UI Toolkit
2d ago
Anybody knows if there's a simple way to have a text field with a search popup in UIElements? I'm looking for something like UnityEditorJunkie SearchableEnum, but for text fields in UI Elements. I checked at ToolbarPopupSearchField, but it's not the same behaviour I'm looking for.
I may end up trying to build one, but it seems like something that could already exist somewhere, so I thought I'd ask here first ..read more
Unity3D Forum » UI Toolkit
2d ago
I want to change the styling of every button in my game, and for what I understand something like this is meant to be done with TSS theme files.
I've created this ButtonStyle.uss stylesheet:
Code (USS):
.unity-button {
background-color: red;
transition-property: scale;
transition-duration: 0.25s;
}
.unity-button:hover {
background-color: green;
scale: 1.1 1.1;
}
And I've linked this file inside my UnityDefaultRuntimeTheme.tss like this:...
.unity-button:hover backgorund color is ignored in ..read more
Unity3D Forum » UI Toolkit
3d ago
Hi,
I am not getting any click events in my application anymore, I am not sure if this has to do with the newest version of unity. The event debugger still shows all the change events from the runtime bindings, but the click events are not registered in the event debugger (and of course the corresponding handlers are also not called). The `:hover` selectors are also not activated.
These are my input actions:
View attachment 1410747
What can I do to debug this ..read more
Unity3D Forum » UI Toolkit
3d ago
I'm working on a simple UI with an extremely basic interaction: user types in some text and presses "Enter/Return" to commit the text. I understand how to get "change" events. I don't care about those. What I care about is when the user expressly "commits" their adjusted text.
Attempts to detect "Enter/Return" have been unsuccessful. It seems that the TextField UIElement swallows all Keyboard events when it has focus so attempts to add KeyDown event...
How do you detect if someone clicks "Enter/Return" on a TextField ..read more
Unity3D Forum » UI Toolkit
3d ago
I'm building my UI for my project using UI Toolkit but I'm building them in C# as I strongly prefer that over UXML or the editor solutions. Here's the problem, my buttons are behaving strangely and I haven't had this issue before.
I'm working in Unity 2023.2.14f1 for context. I've created my main menu with no issues at all, it has sub menus as well, one for controls, settings, and context for player abilities. Each sub-menu has a button that redirects back to the main menu. In the main...
My UI buttons have the wrong hitboxes on them (consistently but not always ..read more
Unity3D Forum » UI Toolkit
4d ago
Issue that is happening:
Unity is not running the Asset Moddification hooks like OnWillSaveAssets for USS files when they are edited.
Unity Versions checked:
Unity 2023.2 f20
Unity 6 preview f1
When did OnWillSaveAssets run properly:
1. When creating a new USS file and confirming it's name it does run on specifically on the meta file for the USS file created.
Steps to reproduce:
To test you can go to Unity's API page for OnWillSaveAssets and even use their default example code snippet....
AssetModificationProcessor.OnWillSaveAssets not running when saving certain UI Toolkit files ..read more
Unity3D Forum » UI Toolkit
4d ago
What do these numbers mean? (If it's documented somewhere, I apologize. I searched for it and I can't find it)
View attachment 1410000 ..read more