Exemplo n.º 1
0
 public override void sleep()
 {
     machine.sleep();
     running   = false;
     currState = ControlBinderStateMachine.State.Sleep;
 }
Exemplo n.º 2
0
 void Update()
 {
     ControlBinderStateMachine.State prevState = currState;
     if (running)
     {
         bool accept = CustomInput.AcceptFreshPressDeleteOnRead;
         currState = machine.update(accept);
         if (prevState != currState)
         {
             foreach (GameObject g in cursors)
             {
                 g.SetActive(false);
             }
             int cursor = (int)currState - 1;
             if (cursor >= 0 && cursor < 16)
             {
                 cursors[cursor].SetActive(true);
             }
             else if (currState == ControlBinderStateMachine.State.Prep)
             {
                 Kernel.disalble();
             }
             else if (prevState == ControlBinderStateMachine.State.Holding)
             {
                 Kernel.enalble();
             }
         }
         if (accept)
         {
             if (currState == ControlBinderStateMachine.State.Default)
             {
                 CustomInput.DefaultPad();
                 Attack.text      = CustomInput.GamePadAttack;
                 Block.text       = CustomInput.GamePadBlock;
                 Jump.text        = CustomInput.GamePadJump;
                 CycleLeft.text   = CustomInput.GamePadCycleLeft;
                 CycleRight.text  = CustomInput.GamePadCycleRight;
                 Left.text        = CustomInput.GamePadLeft;
                 Right.text       = CustomInput.GamePadRight;
                 ChangeColor.text = CustomInput.GamePadChangeColor;
                 Up.text          = CustomInput.GamePadUp;
                 Down.text        = CustomInput.GamePadDown;
                 Super.text       = CustomInput.GamePadSuper;
                 Accept.text      = CustomInput.GamePadAccept;
                 Cancel.text      = CustomInput.GamePadCancel;
                 Pause.text       = CustomInput.GamePadPause;
             }
             if (currState == ControlBinderStateMachine.State.Exit)
             {
                 Kernel.controlsExit();
             }
         }
         if (currState != ControlBinderStateMachine.State.GettingKey)
         {
             if (CustomInput.CancelFreshPressDeleteOnRead)
             {
                 Kernel.controlsExit();
             }
         }
     }
 }
Exemplo n.º 3
0
 void Update()
 {
     ControlBinderStateMachine.State prevState = currState;
     if (running)
     {
         bool accept = CustomInput.AcceptFreshPressDeleteOnRead;
         currState = machine.update(accept);
         if (prevState != currState)
         {
             foreach (GameObject g in cursors)
             {
                 g.SetActive(false);
             }
             int cursor = (int)currState - 1;
             if (cursor >= 0 && cursor < 16)
             {
                 cursors[cursor].SetActive(true);
             }
             else if (currState == ControlBinderStateMachine.State.Prep)
             {
                 Kernel.disalble();
             }
             else if (prevState == ControlBinderStateMachine.State.Holding)
             {
                 Kernel.enalble();
             }
         }
         if (accept)
         {
             if (currState == ControlBinderStateMachine.State.Default)
             {
                 CustomInput.DefaultKey();
                 Attack.text      = CustomInput.KeyBoardAttack.ToString();
                 Block.text       = CustomInput.KeyBoardBlock.ToString();
                 Jump.text        = CustomInput.KeyBoardJump.ToString();
                 CycleLeft.text   = CustomInput.KeyBoardCycleLeft.ToString();
                 CycleRight.text  = CustomInput.KeyBoardCycleRight.ToString();
                 Left.text        = CustomInput.KeyBoardLeft.ToString() + " / Left Arrow";
                 Right.text       = CustomInput.KeyBoardRight.ToString() + " / Right Arrow";
                 ChangeColor.text = CustomInput.KeyBoardChangeColor.ToString();
                 Up.text          = CustomInput.KeyBoardUp.ToString() + " / Up Arrow";
                 Down.text        = CustomInput.KeyBoardDown.ToString() + " / Down Arrow";
                 Super.text       = CustomInput.KeyBoardSuper.ToString();
                 Accept.text      = CustomInput.KeyBoardAccept.ToString();
                 Cancel.text      = CustomInput.KeyBoardCancel.ToString();
                 Pause.text       = CustomInput.KeyBoardPause.ToString();
             }
             if (currState == ControlBinderStateMachine.State.Exit)
             {
                 Kernel.controlsExit();
             }
         }
         if (currState != ControlBinderStateMachine.State.GettingKey)
         {
             if (CustomInput.CancelFreshPressDeleteOnRead)
             {
                 Kernel.controlsExit();
             }
         }
     }
 }