Newer
Older
Björn Eßwein
committed
using UnityEngine;
Björn Eßwein
committed
using UnityEngine.Events;
Björn Eßwein
committed
public class SwitchScrollUI : MonoBehaviour
{
Björn Eßwein
committed
/// <summary>
/// Reference to the data of the active scroll displayed in the scroll UI
/// </summary>
public static ActiveScroll activeScrollData;
public static UnityEvent OnActiveScrollDataInitialized = new();
Björn Eßwein
committed
public GameObject ScrollShowUI;
public GameObject ScrollWebView;
Björn Eßwein
committed
private void Awake()
{
activeScrollData = GetComponent<ActiveScroll>();
OnActiveScrollDataInitialized.Invoke();
}
Björn Eßwein
committed
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;
}
}
}