using System; using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.UIElements; using BoostComponents; public class ControlsUI : MonoBehaviour { [SerializeField] ShipControls ship; UIDocument uiDocument; Label speed; Label shields; BoostBar boostBar; InterfaceIcon shield; VisualElement accelCtr; VisualElement decelCtr; VisualElement strafeCtr; VisualElement shieldCtr; BoostIndicator[] accelBoosts; BoostIndicator[] decelBoosts; BoostIndicator[] strafeBoosts; BoostIndicator[] shieldBoosts; void Awake() { Init(); } void OnEnable() { Init(); } void Init() { accelBoosts = new BoostIndicator[ship.powerUnit.BoostCharges]; decelBoosts = new BoostIndicator[ship.powerUnit.BoostCharges]; strafeBoosts = new BoostIndicator[ship.powerUnit.BoostCharges]; shieldBoosts = new BoostIndicator[ship.powerUnit.BoostCharges]; uiDocument = GetComponent(); speed = uiDocument.rootVisualElement.Q