Example #1
0
 /// <summary>
 /// 放开Item
 /// </summary>
 /// <param name="evenData"></param>
 /// <param name="obj"></param>
 /// <param name="etl"></param>
 public void UpItem(PointerEventData evenData, GameObject obj, DownUpEvent etl)
 {
     if (evenData.pointerId != _pointerId || _isDraging || _canMoving == false)
     {
         return;
     }
     _pointerId = 100;
     ItemStateBack();
 }
Example #2
0
 /// <summary>
 /// 按下按钮
 /// </summary>
 /// <param name="ms"></param>
 /// <param name="tf"></param>
 /// <param name="etl"></param>
 private void DownButton(MoveState ms, Transform tf, DownUpEvent etl)
 {
     if (_isMoving)
     {
         return;
     }
     _isMoving  = true;
     _moveState = ms;
     ButtonEffect.Scale(tf, delegate { etl.enabled = true; Moving(); });
 }
Example #3
0
        public static DownUpEvent Get(GameObject go)
        {
            DownUpEvent listener = go.GetComponent <DownUpEvent>();

            if (listener == null)
            {
                listener = go.AddComponent <DownUpEvent>();
            }
            return(listener);
        }
Example #4
0
 /// <summary>
 /// 按下按钮
 /// </summary>
 /// <param name="ms"></param>
 /// <param name="tf"></param>
 /// <param name="etl"></param>
 private void DownButton(MoveState ms, Transform tf, DownUpEvent etl)
 {
     if (_isMoving || _canMoving == false)
     {
         return;
     }
     _isMoving  = true;
     _moveState = ms;
     ButtonEffect.Scale(tf, Moving, 1.4f);
 }
Example #5
0
 private void Awake()
 {
     DownUpEvent.Get(_prevButton)._downAction = DownPrevButton;
     DownUpEvent.Get(_nextButton)._downAction = DownNextButton;
     _currentPage.Init(this);
     _nextPage.Init(this);
     if (_totalItemNum != 0)
     {
         Init(_totalItemNum);
     }
 }
Example #6
0
 /// <summary>
 /// 添加事件
 /// </summary>
 private void AddEvent()
 {
     _canMoving = true;
     DownUpEvent.Get(_prevButton)._downAction = DownPrevButton;
     DownUpEvent.Get(_nextButton)._downAction = DownNextButton;
     for (int i = 0; i < _itemList.Count; i++)
     {
         DownUpEvent.Get(_itemList[i])._downAction = DownItem;
         DownUpEvent.Get(_itemList[i])._upAction   = UpItem;
     }
     UpdateButton();
 }
Example #7
0
 /// <summary>
 /// 按下Item
 /// </summary>
 /// <param name="evenData"></param>
 /// <param name="obj"></param>
 /// <param name="etl"></param>
 public void DownItem(PointerEventData eventData, GameObject obj, DownUpEvent etl)
 {
     if (_canMoving == false || _pointerId != 100)
     {
         return;
     }
     _pointerId  = eventData.pointerId;
     _chosedItem = obj;
     if (_downStateAction != null)
     {
         _downStateAction(_chosedItem);
     }
 }
Example #8
0
 /// <summary>
 /// 下一页
 /// </summary>
 /// <param name="evenData"></param>
 /// <param name="obj"></param>
 /// <param name="etl"></param>
 private void DownNextButton(PointerEventData evenData, GameObject obj, DownUpEvent etl)
 {
     DownButton(MoveState.一页, obj.transform, etl);
 }