using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SelectedObjectVisual : MonoBehaviour {
    
    [SerializeField] private GameObject _baseCounter;
    [SerializeField] private GameObject _visualCounterSelected;
    
    private void Start() {
        //Using start to I can assure the player exists
        PlayerController.Instance.GetComponent<InteractionBehaviour>().OnSelectedCounter += OnOnSelectedCounterChange;
    }

    private void OnOnSelectedCounterChange(object sender, InteractionBehaviour.OnSelectedCounterArgs e) {
        if (e.selectedCounter == _baseCounter) {
            _visualCounterSelected.SetActive(true);
        }
        else {
            _visualCounterSelected.SetActive(false);
        }
    }
}