UnityGame/Library/PackageCache/com.unity.multiplayer.center/Editor/MultiplayerCenterWindow/UI/ViewUtils.cs

19 lines
546 B
C#
Raw Normal View History

2024-10-27 10:53:47 +03:00
using UnityEngine.UIElements;
namespace Unity.Multiplayer.Center.Window.UI
{
internal static class ViewUtils
{
public static void MoveToggleLeft(BaseBoolField button)
{
var label = button.Q<Label>();
button.Insert(button.childCount - 1, label);
// equivalent to button.Children.First()
using var iterator = button.Children().GetEnumerator();
iterator.MoveNext();
var first = iterator.Current;
first.style.flexGrow = 0;
}
}
}