using System; using JetBrains.Annotations; using Unity.Cloud.Collaborate.UserInterface; using UnityEditor; using UnityEngine.UIElements; namespace Unity.Cloud.Collaborate.Components { internal class Paginator : VisualElement { public const string UssClassName = "paginator"; public const string PageTextUssClassName = UssClassName + "__page-text"; public const string BackButtonUssClassName = UssClassName + "__back-button"; public const string ForwardsButtonUssClassName = UssClassName + "__forwards-button"; static readonly string k_LayoutPath = $"{CollaborateWindow.LayoutPath}/{nameof(Paginator)}.uxml"; static readonly string k_StylePath = $"{CollaborateWindow.StylePath}/{nameof(Paginator)}.uss"; public const int MoveBackwards = -1; public const int MoveForwards = 1; public event Action ClickedMovePage; readonly Label m_PageText; readonly Button m_BackButton; readonly Button m_ForwardsButton; public Paginator() { // Get the layout AddToClassList(UssClassName); AssetDatabase.LoadAssetAtPath(k_LayoutPath).CloneTree(this); styleSheets.Add(AssetDatabase.LoadAssetAtPath(k_StylePath)); m_PageText = this.Q