public void ForceInputKey(KeyControl.KeyName keyName)
        {
            switch (keyName)
            {
            case KeyControl.KeyName.UP:
                if (!AnimationViewPositionNow)
                {
                    ShowChildPrev();
                }
                break;

            case KeyControl.KeyName.DOWN:
                if (!AnimationViewPositionNow)
                {
                    ShowChildNext();
                }
                break;

            case KeyControl.KeyName.MARU:
                OnKeyPressCircle();
                break;

            case KeyControl.KeyName.L:
                MoveByView(-GetUserViewingLength());
                break;

            case KeyControl.KeyName.R:
                MoveByView(GetUserViewingLength());
                break;

            case KeyControl.KeyName.BATU:
                OnAction(ActionType.OnBack, this, ViewFocus);
                break;
            }
        }
        public void MoveScrollBar(KeyControl.KeyName key)
        {
            float num = objCount - viewRange;

            if (num <= 0f)
            {
                return;
            }
            float num2 = 1f / num;

            Debug.Log(key);
            switch (key)
            {
            case KeyControl.KeyName.DOWN:
                if (_scrollBar.value < 1f)
                {
                    _scrollBar.value += num2;
                }
                break;

            case KeyControl.KeyName.UP:
                if (_scrollBar.value > 0f)
                {
                    _scrollBar.value -= num2;
                }
                break;
            }
        }
        public void MoveScrollBar(KeyControl.KeyName key)
        {
            float num = (float)(this.objCount - this.viewRange);

            if (num <= 0f)
            {
                return;
            }
            float num2 = 1f / num;

            Debug.Log(key);
            if (key == KeyControl.KeyName.DOWN)
            {
                if (this._scrollBar.value < 1f)
                {
                    this._scrollBar.value += num2;
                }
            }
            else if (key == KeyControl.KeyName.UP)
            {
                if (this._scrollBar.value > 0f)
                {
                    this._scrollBar.value -= num2;
                }
            }
        }
        public void SetKeyScroll(KeyControl.KeyName key)
        {
            switch (key)
            {
            case KeyControl.KeyName.DOWN:
                if (index == objCount)
                {
                    break;
                }
                if (CheckScrollBar())
                {
                    index = topIndex;
                    break;
                }
                if (index < objCount)
                {
                    index++;
                }
                if (underIndex < index)
                {
                    MoveScrollBar(key);
                    topIndex++;
                    underIndex++;
                    Debug.Log("True top" + topIndex + " under:" + underIndex + "  index:" + index);
                }
                break;

            case KeyControl.KeyName.UP:
                if (index == 1)
                {
                    break;
                }
                if (CheckScrollBar())
                {
                    index = topIndex;
                    break;
                }
                if (index > 1)
                {
                    index--;
                }
                if (topIndex > index)
                {
                    MoveScrollBar(key);
                    topIndex--;
                    underIndex--;
                    Debug.Log("True top" + topIndex + " under:" + underIndex + "  index:" + index);
                }
                break;
            }
        }
Esempio n. 5
0
 private IEnumerator WaitKey(KeyControl keyController, KeyControl.KeyName waitKey, Action callBack)
 {
     mTransform_TouchNextArea.SetActive(isActive: true);
     keyController.ClearKeyAll();
     keyController.firstUpdate = true;
     while (keyController != null)
     {
         if (keyController.keyState[(int)waitKey].down || !mTransform_TouchNextArea.gameObject.activeSelf)
         {
             callBack?.Invoke();
             keyController = null;
         }
         yield return(null);
     }
     mTransform_TouchNextArea.SetActive(isActive: false);
 }
Esempio n. 6
0
        public void ForceInputKey(KeyControl.KeyName keyName)
        {
            switch (keyName)
            {
            case KeyControl.KeyName.BATU:
                this.OnAction(ActionType.OnBack, this, this.ViewFocus);
                return;

            case KeyControl.KeyName.MARU:
                this.OnKeyPressCircle();
                return;

            case KeyControl.KeyName.SHIKAKU:
            case KeyControl.KeyName.SANKAKU:
            case KeyControl.KeyName.SELECT:
            case KeyControl.KeyName.START:
IL_2C:
                if (keyName != KeyControl.KeyName.DOWN)
                {
                    return;
                }
                if (!this.AnimationViewPositionNow)
                {
                    this.ShowChildNext();
                }
                return;

            case KeyControl.KeyName.L:
                this.MoveByView(-this.GetUserViewingLength());
                return;

            case KeyControl.KeyName.R:
                this.MoveByView(this.GetUserViewingLength());
                return;

            case KeyControl.KeyName.UP:
                if (!this.AnimationViewPositionNow)
                {
                    this.ShowChildPrev();
                }
                return;
            }
            goto IL_2C;
        }
        public int GetIndex(KeyControl.KeyName iName, int defVal)
        {
            int num = -1;

            switch (iName)
            {
            case KeyControl.KeyName.UP:
                num = this.Up;
                break;

            case KeyControl.KeyName.UP_RIGHT:
                num = this.UpRight;
                break;

            case KeyControl.KeyName.RIGHT:
                num = this.Right;
                break;

            case KeyControl.KeyName.DOWN_RIGHT:
                num = this.DownRight;
                break;

            case KeyControl.KeyName.DOWN:
                num = this.Down;
                break;

            case KeyControl.KeyName.DOWN_LEFT:
                num = this.DownLeft;
                break;

            case KeyControl.KeyName.LEFT:
                num = this.Left;
                break;

            case KeyControl.KeyName.UP_LEFT:
                num = this.UpLeft;
                break;
            }
            return((num != -1) ? num : defVal);
        }
        private int getIndexMapValue(int nowIndex, KeyControl.KeyName keyName)
        {
            int num  = keyName - KeyControl.KeyName.UP;
            int num2 = num + 1;
            int num3 = num - 1;

            if (num2 > 7)
            {
                num2 = 0;
            }
            if (num3 < 0)
            {
                num3 = 7;
            }
            this.indexMapBuf[0] = this.indexMapList.get_Item(nowIndex).up;
            this.indexMapBuf[1] = this.indexMapList.get_Item(nowIndex).rightUp;
            this.indexMapBuf[2] = this.indexMapList.get_Item(nowIndex).right;
            this.indexMapBuf[3] = this.indexMapList.get_Item(nowIndex).rightDown;
            this.indexMapBuf[4] = this.indexMapList.get_Item(nowIndex).down;
            this.indexMapBuf[5] = this.indexMapList.get_Item(nowIndex).leftDown;
            this.indexMapBuf[6] = this.indexMapList.get_Item(nowIndex).left;
            this.indexMapBuf[7] = this.indexMapList.get_Item(nowIndex).leftUp;
            if (this.indexMapBuf[num] != 0)
            {
                return(this.indexMapBuf[num]);
            }
            if (this.indexMapBuf[num2] != 0)
            {
                return(this.indexMapBuf[num2]);
            }
            if (this.indexMapBuf[num3] != 0)
            {
                return(this.indexMapBuf[num3]);
            }
            return(nowIndex);
        }
 public int GetNextIndex(KeyControl.KeyName iName, int defVal)
 {
     return(this._clsNextInfos.GetIndex(iName, defVal));
 }
 public bool GetWClick(KeyControl.KeyName iName)
 {
     return(this.GetWClick((int)iName));
 }
 private void setKeyState(int keyName, bool press)
 {
     KeyControl.KeyState keyState = this.keyState.get_Item(keyName);
     if (press)
     {
         this.isAnyKey = true;
         if (!keyState.press)
         {
             keyState.down = true;
             if (LogDrawer.exist())
             {
                 SingletonMonoBehaviour <LogDrawer> .Instance.addDebugText(keyName.ToString());
             }
         }
         else
         {
             keyState.down = false;
         }
         keyState.holdTime += Time.get_deltaTime();
         if (keyState.holdTime > this.holdJudgeTime)
         {
             keyState.hold = true;
         }
         keyState.up    = false;
         keyState.press = true;
         if (this.AutoDownKeys.IndexOf((KeyControl.KeyName)keyName) != -1 && keyState.hold && (this.HoldLockKey == KeyControl.KeyName.KEY_NUM || keyName == (int)this.HoldLockKey))
         {
             this.HoldLockKey = (KeyControl.KeyName)keyName;
             float num;
             if (keyName != 8 && keyName != 10 && keyName != 12 && keyName != 14)
             {
                 num = this.keyInputIntervalButton;
                 this.isDirectKeyHold = true;
             }
             else
             {
                 num = this.keyInputInterval;
             }
             if (this.intervalTime > num)
             {
                 keyState.down     = true;
                 this.intervalTime = 0f;
             }
             else
             {
                 this.intervalTime += Time.get_deltaTime();
             }
         }
     }
     else
     {
         keyState.down     = false;
         keyState.holdTime = 0f;
         keyState.hold     = false;
         if (keyState.press)
         {
             keyState.up = true;
         }
         else
         {
             keyState.up = false;
         }
         keyState.press = false;
         if (this.HoldLockKey == (KeyControl.KeyName)keyName)
         {
             this.HoldLockKey = KeyControl.KeyName.KEY_NUM;
         }
     }
 }
 public bool GetHold(KeyControl.KeyName iName)
 {
     return(this.GetHold((int)iName));
 }
 public float GetHoldTime(KeyControl.KeyName iName)
 {
     return(this.GetHoldTime((int)iName));
 }
 public bool GetPress(KeyControl.KeyName iName)
 {
     return(this.GetPress((int)iName));
 }
 public bool GetDown(KeyControl.KeyName iName)
 {
     return(this.GetDown((int)iName));
 }
 public void addHoldAutoDownKey(KeyControl.KeyName keyname)
 {
     this.AutoDownKeys.Add(keyname);
 }
 public void SetKeyScroll(KeyControl.KeyName key)
 {
     if (key == KeyControl.KeyName.DOWN)
     {
         if (this.index == this.objCount)
         {
             return;
         }
         if (this.CheckScrollBar())
         {
             this.index = this.topIndex;
         }
         else
         {
             if (this.index < this.objCount)
             {
                 this.index++;
             }
             if (this.underIndex < this.index)
             {
                 this.MoveScrollBar(key);
                 this.topIndex++;
                 this.underIndex++;
                 Debug.Log(string.Concat(new object[]
                 {
                     "True top",
                     this.topIndex,
                     " under:",
                     this.underIndex,
                     "  index:",
                     this.index
                 }));
             }
         }
     }
     else if (key == KeyControl.KeyName.UP)
     {
         if (this.index == 1)
         {
             return;
         }
         if (this.CheckScrollBar())
         {
             this.index = this.topIndex;
         }
         else
         {
             if (this.index > 1)
             {
                 this.index--;
             }
             if (this.topIndex > this.index)
             {
                 this.MoveScrollBar(key);
                 this.topIndex--;
                 this.underIndex--;
                 Debug.Log(string.Concat(new object[]
                 {
                     "True top",
                     this.topIndex,
                     " under:",
                     this.underIndex,
                     "  index:",
                     this.index
                 }));
             }
         }
     }
 }
 private IEnumerator WaitKey(KeyControl keyController, KeyControl.KeyName waitKey, Action callBack)
 {
     UIRevampBalloon.< WaitKey > c__IteratorC4 <WaitKey> c__IteratorC = new UIRevampBalloon.< WaitKey > c__IteratorC4();