Пример #1
0
        private void RemoveHandlers(Slider slider)
        {
            SliderCallbacks callback = slider.GetComponent <SliderCallbacks>();

            if (callback != null)
            {
                callback.OnEndDragCallback -= OnEndDrag;
                callback.OnEnterCallback   -= OnEnter;
                callback.OnExitCallback    -= OnExit;
            }
        }
Пример #2
0
        private void AddHandlers(Slider slider)
        {
            SliderCallbacks callback = slider.GetComponent <SliderCallbacks>();

            if (callback == null)
            {
                callback = slider.gameObject.AddComponent <SliderCallbacks>();
            }

            callback.OnEndDragCallback += OnEndDrag;
            callback.OnEnterCallback   += OnEnter;
            callback.OnExitCallback    += OnExit;
        }