暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

QueryVisualElementsExtensions.cs 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using UnityEngine.UIElements;
  2. namespace Unity.PlasticSCM.Editor
  3. {
  4. internal static class QueryVisualElementsExtensions
  5. {
  6. /// <summary>
  7. /// Shows the element regardless if it is has been hidden or collapsed.
  8. /// </summary>
  9. /// <param name="query">The element query</param>
  10. /// <typeparam name="T">The element type</typeparam>
  11. internal static void Show<T>(this UQueryBuilder<T> query)
  12. where T: VisualElement
  13. {
  14. ((T)query).Show();
  15. }
  16. /// <summary>
  17. /// Removes the element from the layout, freeing its space and position.
  18. /// </summary>
  19. /// <param name="query">The element query</param>
  20. /// <typeparam name="T">The element type</typeparam>
  21. internal static void Collapse<T>(this UQueryBuilder<T> query)
  22. where T: VisualElement
  23. {
  24. ((T)query).Collapse();
  25. }
  26. /// <summary>
  27. /// Hides the element while preserving its space and position in the layout.
  28. /// </summary>
  29. /// <param name="query">The element query</param>
  30. /// <typeparam name="T">The element type</typeparam>
  31. internal static void Hide<T>(this UQueryBuilder<T> query)
  32. where T: VisualElement
  33. {
  34. ((T)query).Collapse();
  35. }
  36. }
  37. }