TryGet(string, out UniqueStyleString)
Attempts to retrieve an existing UniqueStyleString from a string value.
阅读时间1 分钟最后更新于 21 天前
Definition
- Type: Method
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
TryGet(string, UniqueStyleString)
public static bool TryGet(string value, out UniqueStyleString result)
Parameters
The string value that the resulting UniqueStyleString needs to represent
A UniqueStyleString that matches the provided value, if any
Returns
Type | Description |
|---|---|
| bool | True if a UniqueStyleString representing the provided value currently exists |
Remarks
Methods such as VisualElement.AddToClassList guarantee that the UniqueStyleString exists after the call. If returns false for a given value, then there is no need to call VisualElement.ClassListContains for that same value, as it will necessarily return false. Similarly, there is no need to call VisualElement.RemoveFromClassList for that value.
TryGet