using UnityEngine; using UnityEngine.UIElements; using VOID.Generic.Dict; using VOID.Generic.Objects.Unit; using VOID.Generic.Objects.Unit.Events; using VOID.Generic.Player; using VOID.Generic.Player.Input; using VOID.UserInterface.Game.Util; namespace VOID.UserInterface.Game { public class ActionBarSlotsUI : MonoBehaviour { public static ActionBarSlotsUI current {get; private set;} // ActionBar for this unit private UnitObject _unit; private UnitObjectActionBar _actionBar; // Visual Elements - Slots private VisualElement _slotListElement; private VisualElement[] _slotElements; private Button _slotsLockerButton; private Button _slotsChangerNextButton; private Button _slotsChangerPreviousButton; private Label _slotsChangerNumberLabel; public SlotUI[] slotsUI { get; private set; } private int _slotsPage = 1; private int _slotsPageCount = 4; private int _slotsPerPage; // References private ShortcutsInputManager _shortcutsInputManager; private PlayerController _playerController; private void Awake() { current = this; var uiDocument = gameObject.GetComponent(); var templateElement = uiDocument.rootVisualElement; // Find all important elements _slotListElement = templateElement.Q("slots"); _slotsChangerNextButton = templateElement.Q("slots-changer").Q