docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class AppUIThemeAsset

    A custom App UI theme, imported from a .appuitheme.json file.

    Inheritance
    object
    Object
    ScriptableObject
    AppUIThemeAsset
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetEntityId()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.dll
    Syntax
    public class AppUIThemeAsset : ScriptableObject
    Remarks

    This is the main object of the imported asset, with the two compiled stylesheets stored alongside it as sub-assets. Making the theme — rather than the stylesheet — the main object keeps AssetDatabase.FindAssets("t:AppUIThemeAsset") a clean way to enumerate the custom themes in a project, which is what populates the theme dropdowns.

    The type lives in the runtime assembly even though only the editor ever creates one, so that player code can hold a serialized reference to a theme and apply it at run time. Were it editor-only, the usage below would not compile in a build.

    To use one, hold a reference to the theme — a serialized field assigned in the inspector — then add its styleSheet to a panel and set the theme name:

    [SerializeField] AppUIThemeAsset m_Theme;
    

    void Start() { var panel = GetComponent<UIDocument>().rootVisualElement.Q<Panel>(); panel.styleSheets.Add(m_Theme.styleSheet); panel.theme = m_Theme.themeName; }

    That layers the theme over whatever App UI theme is already loaded, so any token the custom theme does not define keeps its value from the base theme rather than resolving to nothing. Assigning themeStyleSheet to PanelSettings.themeStyleSheet instead replaces the theme file wholesale.

    Properties

    baseTheme

    The App UI theme this one was derived from.

    Declaration
    public string baseTheme { get; }
    Property Value
    Type Description
    string

    colorScheme

    Whether the theme reads as dark or light.

    Declaration
    public string colorScheme { get; }
    Property Value
    Type Description
    string

    displayName

    A human-readable name for menus and inspectors.

    Declaration
    public string displayName { get; }
    Property Value
    Type Description
    string

    styleSheet

    The class-scoped stylesheet, for element.styleSheets.Add(...). This is the recommended way to apply a custom theme.

    Declaration
    public StyleSheet styleSheet { get; }
    Property Value
    Type Description
    StyleSheet

    themeName

    The theme's identifier, which is also the value to assign to Panel.theme. The generated stylesheet defines .appui--<themeName>.

    Declaration
    public string themeName { get; }
    Property Value
    Type Description
    string

    themeStyleSheet

    A standalone theme file, assignable to PanelSettings.themeStyleSheet. Null when the USS could not be compiled in this Unity version.

    Declaration
    public ThemeStyleSheet themeStyleSheet { get; }
    Property Value
    Type Description
    ThemeStyleSheet

    tokenCount

    How many tokens the theme defines.

    Declaration
    public int tokenCount { get; }
    Property Value
    Type Description
    int

    tokens

    The theme's tokens: App UI tokens keyed without the --appui- prefix, and any other custom property the theme carries under its full --name.

    Declaration
    public IReadOnlyDictionary<string, string> tokens { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, string>
    Remarks

    Stored as two parallel lists because Unity cannot serialise a dictionary; rebuilt on demand rather than cached, since this is only for inspectors and tooling.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)