using UnityEngine;
using UnityEngine.Events;

public class SwitchScrollUI : MonoBehaviour
{
    /// <summary>
    /// Reference to the data of the active scroll displayed in the scroll UI
    /// </summary>
    public static ActiveScroll activeScrollData;
    public static UnityEvent OnActiveScrollDataInitialized = new();

    public GameObject ScrollShowUI;
    public GameObject ScrollWebView;

    private void Awake()
    {
        activeScrollData = GetComponent<ActiveScroll>();
        OnActiveScrollDataInitialized.Invoke();
    }
    void OnEnable()
    {
        switch (UIconfig.scrollViewVersion)
        {
            case UIconfig.ScrollViewVersion.ScrollShow:
                ScrollWebView.SetActive(false);
                ScrollShowUI.SetActive(true);
                break;
            case UIconfig.ScrollViewVersion.ScrollWebView:
                ScrollShowUI.SetActive(false);
                ScrollWebView.SetActive(true);
                break;
            default:
                ScrollShowUI.SetActive(false);
                ScrollWebView.SetActive(true);
                break;
        }
    }
}