Class StyleSheet
Style sheets are applied to visual elements in order to control the layout and visual appearance of the user interface.
Namespace: UnityEngine.UIElements
Syntax
public class StyleSheet : ScriptableObject
Remarks
The StyleSheet class holds the imported data of USS files in your project. Once loaded, a style sheet can be attached to a VisualElement object to affect the element itself and its descendants.
Examples
public class MyEditorWindow : EditorWindow
{
void OnEnable()
{
rootVisualElement.styleSheets.Add(AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/styles.uss"));
}
}
Properties
contentHash
A hash value computed from the stylesheet content.
Declaration
public int contentHash { get; set; }
Property Value
Type | Description |
---|---|
Int32 |