AddToClassList
Adds a class to the class list of the element in order to assign styles from USS. Note the class name is case-sensitive.
Read time 3 minutesLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
AddToClassList(string)
Adds a class to the class list of the element in order to assign styles from USS. Note the class name is case-sensitive.
public void AddToClassList(string className)
Parameters
The name of the class to add to the list.
Remarks
This method has no effect if class name is null or empty.
AddToClassList(UniqueStyleString)
Adds a class to the class list of the element in order to assign styles from USS. Note the class name is case-sensitive.
public void AddToClassList(UniqueStyleString className)
Parameters
The name of the class to add to the list.
Remarks
This method has no effect if class name is null or empty.
AddToClassList(string, string)
Adds classes to the class list of the element in order to assign styles from USS. Note the class name is case-sensitive.
public void AddToClassList(string className, string className2)
Parameters
Remarks
This method ignores class names that are null or empty. This method has no effect if all provided class names are null or empty.
AddToClassList(UniqueStyleString, UniqueStyleString)
Adds classes to the class list of the element in order to assign styles from USS. Note the class name is case-sensitive.
public void AddToClassList(UniqueStyleString className, UniqueStyleString className2)
Parameters
The name of the class to add to the list.
The name of a second class to add to the list.
Remarks
This method ignores class names that are null or empty. This method has no effect if all provided class names are null or empty.
AddToClassList(string[])
Adds multiple classes to the class list of the element in order to assign styles from USS. Note the class names are case-sensitive.
public void AddToClassList(params string[] classNames)
Parameters
The names of the classes to add to the list.
Remarks
This method ignores class names that are null or empty. This method has no effect if all provided class names are null or empty.
AddToClassList(UniqueStyleString[])
Adds multiple classes to the class list of the element in order to assign styles from USS. Note the class names are case-sensitive.
public void AddToClassList(params UniqueStyleString[] classNames)
Parameters
The names of the classes to add to the list.
Remarks
This method ignores class names that are null or empty. This method has no effect if all provided class names are null or empty.
AddToClassList(ReadOnlySpan<UniqueStyleString>)
Adds multiple classes to the class list of the element in order to assign styles from USS. Note the class names are case-sensitive.
public void AddToClassList(ReadOnlySpan<UniqueStyleString> classNames)
Parameters
The names of the classes to add to the list.
Remarks
This method ignores class names that are null or empty. This method has no effect if all provided class names are null or empty.