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

public class DebugOptionButton : MonoBehaviour
{
    [SerializeField] private Button debugOptionButton;
    // Start is called before the first frame update
    void Start()
    {
#if UNITY_EDITOR || DEVELOPMENT_BUILD
        
        debugOptionButton.OnClickAsObservable().Subscribe(_ =>
        {
            var currentScene = (GameScenes)Enum.Parse(typeof(GameScenes), SceneManager.GetActiveScene().name, false);
            LocalCacheManager.Save(DebugOptionManager.DebugPrevSceneTag, currentScene);
            TransitionManager.Instance.LoadScene(GameScenes.DebugOption);
        }).AddTo(this);
#else
        Destroy(gameObject);
#endif
    }
}
