using System;
using UniRx;
using UnityEngine;
using UnityEngine.UI;

namespace MyGame.Scenes.marketing.Scripts
{
    public class ButtonOnOff : MonoBehaviour
    {
        [SerializeField] private Button button;
        [SerializeField] private GameObject onObject;
        [SerializeField] private GameObject offObject;
        public IObservable<Unit> OnClickObservable => button.OnClickAsObservable().TakeUntilDestroy(this);

        public void SetActive(bool active)
        {
            onObject.SetActive(active);
            offObject.SetActive(!active);
        }
    }
}