Ejemplo n.º 1
0
 /// <summary>
 /// 检测持续按下
 /// 主要用于检测摇杆实现快速翻动
 /// </summary>
 /// <param name="keyType"></param>
 /// <param name="rockValue"></param>
 private void Instance_KeyPressHandle(UIManager.KeyType keyType, Vector2 rockValue)
 {
     //只有获取焦点时才可以使用摇杆
     if (focused && keyType == UIManager.KeyType.LEFT_ROCKER)
     {
         //向上- 向下+
         if (Mathf.Abs(rockValue.y) > 0)
         {
             uiDepostiList.MoveScroll(-rockValue.y);
             if (!uiDepostiList.ItemIsShow(focusUIListItem))
             {
                 if (focusUIListItem && focusUIListItem.childImage)
                 {
                     focusUIListItem.childImage.enabled = false;
                 }
                 focusUIListItem = rockValue.y > 0 ? uiDepostiList.FirstShowItem() : uiDepostiList.LastShowItem();
                 if (focusUIListItem && focusUIListItem.childImage)
                 {
                     focusUIListItem.childImage.enabled = true;
                 }
             }
         }
     }
 }