Class UnityLogo
The Unity brand mark.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class UnityLogo : BaseVisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
UnityLogo draws the mark through an Icon, so it takes its size from the same
--appui-alias-control-sizing-icon-* ramp as every other glyph and rescales with density.
The image is the brand asset the package already ships, tinted with the primary icon token so it
follows the current theme.
variant controls the fill. Filled is the solid mark, Empty dims it evenly, and Animated fills it in from empty over two seconds and restarts. USS has no keyframe animations, so the animated variant is driven from C# by a scheduled item that writes the icon's opacity every frame. The driver only runs while the element is attached to a panel, and it clears the opacity it wrote when it stops.
The logo ignores pointer events and is not focusable.
Examples
The solid mark, at the default medium size.
var logo = new UnityLogo();
parentElement.Add(logo);
A large logo that fills itself in, for a splash or a loading state.
var logo = new UnityLogo
{
variant = UnityLogoVariant.Animated,
size = IconSize.Lg
};
parentElement.Add(logo);
The three variants in UXML.
<appui:UnityLogo />
<appui:UnityLogo variant="Empty" />
<appui:UnityLogo variant="Animated" size="Lg" />
Constructors
UnityLogo()
Default constructor.
Declaration
public UnityLogo()
Fields
iconUssClassName
The styling class of the Icon the logo is drawn with.
Declaration
public const string iconUssClassName = "appui-unity-logo__icon"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The UnityLogo main styling class.
Declaration
public const string ussClassName = "appui-unity-logo"
Field Value
| Type | Description |
|---|---|
| string |
variantUssClassName
The UnityLogo variant styling class.
Declaration
public const string variantUssClassName = "appui-unity-logo--"
Field Value
| Type | Description |
|---|---|
| string |
Properties
icon
The Icon the logo is drawn with.
Declaration
public Icon icon { get; }
Property Value
| Type | Description |
|---|---|
| Icon |
size
The size of the logo, on the shared icon sizing ramp. Md by default.
Declaration
[CreateProperty]
[UxmlAttribute]
public IconSize size { get; set; }
Property Value
| Type | Description |
|---|---|
| IconSize |
variant
The fill state of the logo. Filled by default.
Declaration
[CreateProperty]
[UxmlAttribute]
public UnityLogoVariant variant { get; set; }
Property Value
| Type | Description |
|---|---|
| UnityLogoVariant |
Methods
GetVariantUssClassName(UnityLogoVariant)
Declaration
public static string GetVariantUssClassName(UnityLogoVariant enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityLogoVariant | enumValue |
Returns
| Type | Description |
|---|---|
| string |