using TMPro; using UnityEngine; [RequireComponent (typeof(TextMeshProUGUI))] public class GamemodePriceLabel : MonoBehaviour { [SerializeField] private GameMode _gameMode; private TextMeshProUGUI _label; void Start() { _label = GetComponent(); UpdatePrice(); PaymentSystem.OnPaymentDataChanged += UpdatePrice; } private void UpdatePrice() => _label.text = PaymentSystem.GetPriceString(_gameMode); }