Skip to content
Snippets Groups Projects
SwitchScrollUI.cs 1.1 KiB
Newer Older
  • Learn to ignore specific revisions
  •     /// <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;
            }
        }
    }