コード例 #1
0
 public void setEnableIndex(int[] indexArray)
 {
     int[,] array = new int[this.orignalIndexMap.GetLength(0), this.orignalIndexMap.GetLength(1)];
     Array.Copy(this.orignalIndexMap, 0, array, 0, this.orignalIndexMap.get_Length());
     for (int i = 0; i < array.GetLength(0); i++)
     {
         for (int j = 0; j < array.GetLength(1); j++)
         {
             if (array[i, j] != 0)
             {
                 bool flag = false;
                 for (int k = 0; k < indexArray.Length; k++)
                 {
                     if (array[i, j] == indexArray[k])
                     {
                         flag = true;
                     }
                 }
                 if (!flag)
                 {
                     array[i, j] = 0;
                 }
             }
         }
     }
     this.controllerMode = KeyControl.Mode.INDEX_MAP;
     this.indexMapList   = new List <KeyControl.IndexMap>();
     this.addIndexMap(array);
 }
コード例 #2
0
 public void useDoubleIndex(int min, int max)
 {
     this.controllerMode = KeyControl.Mode.DOUBL_INDEX;
     this.index2         = min;
     this.minIndex2      = min;
     this.maxIndex2      = max;
 }
コード例 #3
0
 public void setUseIndexMap(int[,] indexMapArray)
 {
     this.controllerMode = KeyControl.Mode.INDEX_MAP;
     this.indexMapList   = new List <KeyControl.IndexMap>();
     this.addIndexMap(indexMapArray);
     this.orignalIndexMap = new int[indexMapArray.GetLength(0), indexMapArray.GetLength(1)];
     Array.Copy(indexMapArray, 0, this.orignalIndexMap, 0, indexMapArray.get_Length());
     this.indexMapBuf = new int[8];
 }
コード例 #4
0
 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;
     }
 }
コード例 #5
0
 public void reset(int min = 0, int max = 0, float holdJudgeTime = 0.4f, float keyInputInterval = 0.1f)
 {
     this.controllerMode         = KeyControl.Mode.NOMAL;
     this.index                  = 0;
     this.minIndex               = min;
     this.maxIndex               = max;
     this.isChangeIndex          = false;
     this.holdJudgeTime          = holdJudgeTime;
     this.keyInputInterval       = keyInputInterval;
     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.isLeftStickStandAlone  = false;
     this.isRightStickStandAlone = false;
 }