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

namespace UI
{
    public class ControllPanel : MonoBehaviour
    {
        Toggle clickedToggle;
        GameObject activeScreen;

        public void SetToggle(Toggle toggle)
        {
            clickedToggle = toggle;
            Sound.SoundController.Instance.Play(SoundType.UIClick);
        }

        public void SetActiveScreen(GameObject screen) => activeScreen = screen;

        public void ShowScreeen(GameObject screen)
        {
            screen.SetActive(screen == activeScreen && clickedToggle.isOn);
        }
    }
}