예제 #1
0
        /// <summary>
        /// Disable points view.
        /// </summary>
        /// <param name="pointsView">Points view.</param>
        protected virtual void DisablePointsView(ScrollBlock pointsView)
        {
            if (pointsView == null)
            {
                return;
            }

            pointsView.Increase = ScrollBlock.DoNothing;
            pointsView.Decrease = ScrollBlock.DoNothing;
            pointsView.Value    = ScrollBlock.DefaultValue;

            var points_drag = pointsView.GetComponent <DragListener>();

            if (points_drag != null)
            {
                points_drag.OnInitializePotentialDragEvent.RemoveListener(OnPointsDragInit);
                points_drag.OnDragStartEvent.RemoveListener(OnPointsDragBegin);
                points_drag.OnDragEvent.RemoveListener(OnPointsDrag);
                points_drag.OnDragEndEvent.RemoveListener(OnPointsDragEnd);
                points_drag.OnScrollEvent.RemoveListener(OnPointsScroll);
            }
        }
예제 #2
0
        /// <summary>
        /// Enable points view.
        /// </summary>
        /// <param name="pointsView">Points view.</param>
        protected virtual void EnablePointsView(ScrollBlock pointsView)
        {
            if (pointsView == null)
            {
                return;
            }

            DataHeaderSize = (pointsView.DefaultItem.transform as RectTransform).rect.size;

            pointsView.AlwaysCenter = false;
            pointsView.Increase     = Increase;
            pointsView.Decrease     = Decrease;
            pointsView.Value        = Value2Text;
            pointsView.UpdateView();

            var points_drag = Utilites.GetOrAddComponent <DragListener>(pointsView);

            points_drag.OnInitializePotentialDragEvent.AddListener(OnPointsDragInit);
            points_drag.OnDragStartEvent.AddListener(OnPointsDragBegin);
            points_drag.OnDragEvent.AddListener(OnPointsDrag);
            points_drag.OnDragEndEvent.AddListener(OnPointsDragEnd);
            points_drag.OnScrollEvent.AddListener(OnPointsScroll);
        }