Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ltmx/Unity.UIToolkit.Extensions

Open more actions menu

Repository files navigation

Unity.UIToolkit.Extensions

Extension Library for Unity UIElements

GitHub package.json version GitHub repo size GitHub top language GitHub Made for Unity

Create UI using LINQ Syntax

Looks :

    public static TextField CreateInputTextField(this VisualElement container)
    {
        var row = container.Row();
        row.Image().USS("logo");
        
        var inputTextField = row.TextField()
            .Multiline(true)
            .Value("Hello")
            .ToolTip("[Shift + Enter] to SEND\n[Esc] to STOP chat")
            .Placeholder("Type your message here")
            .HidePlaceholderOnFocus(true);
        return inputTextField;
    }

Install

Unity > Package Manager > Install via Git URL > paste https://github.com/ltmx/Unity.UIToolkit.Extensions.git

Dependencies (automaticaly installed)

Examples

Create Child Elements

element.Button();
element.TextField();
element.Label();

Styling

element.USS("my-style");
element.RemoveUSS("my-class");
element.ClearUSS("my-class");
element.WhereClassListContains("my-class");
element.FirstElementWithClass("my-class");

// of course everything links together
myButton.WhereClassListContains("unity-text-element").ClearUSS();

An example of how I create a Path Field

public PathField(string name) : base(name)
{
    var button = new ActionButton(OpenPathInExplorer)
        .USS("open-button")
        .FlexShrink(1)
        .FlexGrow(1)
        .AlignSelf(Align.Center)
        .Margin(0)
        .MarginRight(8)
        .Size(24)
        .BackgroundSize(BackgroundSizeType.Contain);
    Insert(1, button);
}

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.