Struct VisualElementStyleSheetSet
This structure manipulates the set of StyleSheet objects attached to the owner VisualElement.
Namespace: UnityEngine.UIElements
Syntax
public struct VisualElementStyleSheetSet : IEquatable<VisualElementStyleSheetSet>
Remarks
VisualElementStyleSheetSet instances can't be created directly. Use the styleSheets property accessor to work with the style sheets of an element.
Properties
count
Number of style sheets attached to the owner element.
Declaration
public int count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Item[Int32]
Reads the value at the specified index in the list of StyleSheet objects attached of the element
Declaration
public StyleSheet this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the StyleSheet |
Property Value
Type | Description |
---|---|
StyleSheet |
Methods
Add(StyleSheet)
Adds a style sheet for the owner element.
Declaration
public void Add(StyleSheet styleSheet)
Parameters
Type | Name | Description |
---|---|---|
StyleSheet | styleSheet |
Clear()
Removes all style sheets for the owner element.
Declaration
public void Clear()
Contains(StyleSheet)
Looks for the specified StyleSheet
Declaration
public bool Contains(StyleSheet styleSheet)
Parameters
Type | Name | Description |
---|---|---|
StyleSheet | styleSheet |
Returns
Type | Description |
---|---|
Boolean | Returns true if the style sheet is attached to the owner element, false otherwise. |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Equals(VisualElementStyleSheetSet)
Compares instances of the VisualElementStyleSheetSet struct for equality.
Declaration
public bool Equals(VisualElementStyleSheetSet other)
Parameters
Type | Name | Description |
---|---|---|
VisualElementStyleSheetSet | other | The structure to compare with. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the two instances refer to the same element, false otherwise. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Remove(StyleSheet)
Removes a style sheet for the owner element.
Declaration
public bool Remove(StyleSheet styleSheet)
Parameters
Type | Name | Description |
---|---|---|
StyleSheet | styleSheet |
Returns
Type | Description |
---|---|
Boolean |
Operators
Equality(VisualElementStyleSheetSet, VisualElementStyleSheetSet)
Compares instances of the VisualElementStyleSheetSet struct for equality.
Declaration
public static bool operator ==(VisualElementStyleSheetSet left, VisualElementStyleSheetSet right)
Parameters
Type | Name | Description |
---|---|---|
VisualElementStyleSheetSet | left | The left operand of the comparison |
VisualElementStyleSheetSet | right | The right operand of the comparison |
Returns
Type | Description |
---|---|
Boolean | True if the two instances refer to the same element, false otherwise. |
Inequality(VisualElementStyleSheetSet, VisualElementStyleSheetSet)
Compares instances of the VisualElementStyleSheetSet struct for inequality.
Declaration
public static bool operator !=(VisualElementStyleSheetSet left, VisualElementStyleSheetSet right)
Parameters
Type | Name | Description |
---|---|---|
VisualElementStyleSheetSet | left | The left operand of the comparison |
VisualElementStyleSheetSet | right | The right operand of the comparison |
Returns
Type | Description |
---|---|
Boolean | Returns false if the two instances refer to the same element, true otherwise. |