using System;
using UnityEngine;
using UnityEngine.UI;

namespace Patterns_And_Principles.Patterns.The_Singleton_Pattern.SimpleSingleton.Script
{
    public class TestScript : MonoBehaviour
    {
        [SerializeField]
        private Button _testButton;

        private void Awake()
        {
            _testButton.onClick.AddListener(OnTestButtonClick);
        }

        private void OnTestButtonClick()
        {
            SimpleSingleton.Instance.AddCoin(100);
            Debug.Log($"Current coin: {SimpleSingleton.Instance.GetCoin()}");
        }
    }
}