using System; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class UIControl : MonoBehaviour { private static readonly Color BUTTON_NORMAL_COLOR = new Color(0.1450828f, 0.1094224f, 0.2154269f, 1f); private static readonly Color BUTTON_HIGHLIGHED_COLOR = new Color(0.6156863f, 0.2392157f, 0.8392157f, 1f); [SerializeField] private GameObject player; [Header("UI Controls")] [SerializeField] private Text coinsCounterView; [SerializeField] private Text healthCounterView; [SerializeField] private Text endTextView; [SerializeField] private Text reloadTime; [SerializeField] private GameObject buttonSoundSetting; [SerializeField] private GameObject panelMenu; [SerializeField] private GameObject inventoryPanel; [Header("UI Controls (Health settings)")] [SerializeField] private Image healthBar; [SerializeField] private float delta; private Health _playerHealth; private PlayerInventory _playerInventory; private PlayerController _playerController; private Button _buttonSoundSetting; private Text _labelSoundSetting; private float _healthValue; private float _currentHealth; private void Awake() { _playerHealth = player.gameObject.GetComponent(); _playerInventory = player.gameObject.GetComponent(); _playerController = player.gameObject.GetComponent(); _buttonSoundSetting = buttonSoundSetting.GetComponent