Пример #1
0
 public void addIndex()
 {
     if (KeyControlManager.exist())
     {
         Debug.Log("addindex");
         Debug.Log(KeyControlManager.Instance.KeyController.Index);
         KeyControlManager.Instance.KeyController.Index += myIndexNo;
         Debug.Log(KeyControlManager.Instance.KeyController.Index);
     }
 }
 public KeyControl(int min = 0, int max = 0, float holdJudgeTime = 0.4f, float keyInputInterval = 0.1f)
 {
     this.keyState = new Dictionary <int, KeyControl.KeyState>(24);
     for (int i = 0; i < 24; i++)
     {
         this.keyState.set_Item(i, new KeyControl.KeyState());
         this.initKeyState(this.keyState.get_Item(i));
     }
     this.controllerMode         = KeyControl.Mode.NOMAL;
     this.index                  = 0;
     this.minIndex               = min;
     this.maxIndex               = max;
     this.isChangeIndex          = false;
     this.holdJudgeTime          = holdJudgeTime;
     this.keyInputInterval       = keyInputInterval;
     this.keyInputIntervalButton = 0.2f;
     this.intervalTime           = 0f;
     this.upKeyChangeValue       = -1f;
     this.rightKeyChangeValue    = 1f;
     this.downKeyChangeValue     = 1f;
     this.leftKeyChangeValue     = -1f;
     this.firstUpdate            = true;
     this.isLoopIndex            = true;
     this._isRun                 = true;
     this.keyCodeArray           = new KeyCode[24];
     this.keyCodeArray[0]        = 350;
     this.keyCodeArray[1]        = 351;
     this.keyCodeArray[2]        = 352;
     this.keyCodeArray[3]        = 353;
     this.keyCodeArray[4]        = 354;
     this.keyCodeArray[5]        = 355;
     this.keyCodeArray[6]        = 356;
     this.keyCodeArray[7]        = 357;
     this.keyCodeArray[8]        = 358;
     this.keyCodeArray[10]       = 359;
     this.keyCodeArray[12]       = 360;
     this.keyCodeArray[14]       = 361;
     this.isLeftStickStandAlone  = false;
     this.isRightStickStandAlone = false;
     this.AutoDownKeys           = new List <KeyControl.KeyName>();
     this.AutoDownKeys.Add(KeyControl.KeyName.UP);
     this.AutoDownKeys.Add(KeyControl.KeyName.RIGHT);
     this.AutoDownKeys.Add(KeyControl.KeyName.DOWN);
     this.AutoDownKeys.Add(KeyControl.KeyName.LEFT);
     if (KeyControlManager.exist())
     {
         KeyControlManager.Instance.KeyController = this;
     }
 }
Пример #3
0
 public KeyControl(int min = 0, int max = 0, float holdJudgeTime = 0.4f, float keyInputInterval = 0.1f)
 {
     keyState = new Dictionary <int, KeyState>(24);
     for (int i = 0; i < 24; i++)
     {
         keyState[i] = new KeyState();
         initKeyState(keyState[i]);
     }
     controllerMode         = Mode.NOMAL;
     index                  = 0;
     minIndex               = min;
     maxIndex               = max;
     isChangeIndex          = false;
     this.holdJudgeTime     = holdJudgeTime;
     this.keyInputInterval  = keyInputInterval;
     keyInputIntervalButton = 0.2f;
     intervalTime           = 0f;
     upKeyChangeValue       = -1f;
     rightKeyChangeValue    = 1f;
     downKeyChangeValue     = 1f;
     leftKeyChangeValue     = -1f;
     firstUpdate            = true;
     isLoopIndex            = true;
     _isRun                 = true;
     keyCodeArray           = new KeyCode[24];
     keyCodeArray[0]        = KeyCode.Joystick1Button0;
     keyCodeArray[1]        = KeyCode.Joystick1Button1;
     keyCodeArray[2]        = KeyCode.Joystick1Button2;
     keyCodeArray[3]        = KeyCode.Joystick1Button3;
     keyCodeArray[4]        = KeyCode.Joystick1Button4;
     keyCodeArray[5]        = KeyCode.Joystick1Button5;
     keyCodeArray[6]        = KeyCode.Joystick1Button6;
     keyCodeArray[7]        = KeyCode.Joystick1Button7;
     keyCodeArray[8]        = KeyCode.Joystick1Button8;
     keyCodeArray[10]       = KeyCode.Joystick1Button9;
     keyCodeArray[12]       = KeyCode.Joystick1Button10;
     keyCodeArray[14]       = KeyCode.Joystick1Button11;
     isLeftStickStandAlone  = false;
     isRightStickStandAlone = false;
     AutoDownKeys           = new List <KeyName>();
     AutoDownKeys.Add(KeyName.UP);
     AutoDownKeys.Add(KeyName.RIGHT);
     AutoDownKeys.Add(KeyName.DOWN);
     AutoDownKeys.Add(KeyName.LEFT);
     if (KeyControlManager.exist())
     {
         KeyControlManager.Instance.KeyController = this;
     }
 }