Beispiel #1
0
 void OnInputCancel(InputManager.Info data)
 {
     if (data.state == InputManager.State.Pressed && UICamera.selectedObject != null)
     {
         UICamera.Notify(UICamera.selectedObject, "OnKey", KeyCode.Escape);
     }
 }
Beispiel #2
0
 void OnInputEscape(InputManager.Info data)
 {
     if (data.state == InputManager.State.Pressed)
     {
         Execute();
     }
 }
Beispiel #3
0
 void OnEsc(InputManager.Info dat)
 {
     if (dat.state == InputManager.State.Pressed)
     {
         UIModalManager.instance.ModalOpen("menu");
     }
 }
Beispiel #4
0
 void OnInputEscape(InputManager.Info data)
 {
     if (data.state == InputManager.State.Pressed)
     {
         Manager.instance.ModalCloseTop();
     }
 }
Beispiel #5
0
 void OnInput(InputManager.Info dat)
 {
     if (dat.state == InputManager.State.Pressed)
     {
         StartGame();
     }
 }
 void OnInputEscape(InputManager.Info dat)
 {
     if (dat.state == InputManager.State.Pressed)
     {
         Main.instance.sceneManager.LoadScene(Scenes.main);
     }
 }
 void OnInput(InputManager.Info dat)
 {
     if (dat.state == InputManager.State.Pressed)
     {
         Action(-1);
     }
 }
 void OnInputOptions(InputManager.Info dat)
 {
     if (dat.state == InputManager.State.Pressed)
     {
         UIModalManager.instance.ModalOpen("options");
     }
 }
Beispiel #9
0
 void OnInputEnter(InputManager.Info data)
 {
     if (data.state == InputManager.State.Pressed && (!checkSelected || UICamera.selectedObject == gameObject))
     {
         UICamera.Notify(gameObject, "OnClick", null);
     }
 }
Beispiel #10
0
 void OnEnter(InputManager.Info dat)
 {
     if (dat.state == InputManager.State.Released &&
         mMoveState == MoveState.None &&
         LevelManager.instance.curStageData.unlocked)
     {
         UIModalManager.instance.ModalOpen("levelSelect");
     }
 }
Beispiel #11
0
 void OnInputPause(InputManager.Info dat)
 {
     if (dat.state == InputManager.State.Pressed)
     {
         if (!UIModalManager.instance.ModalIsInStack("pause"))
         {
             UIModalManager.instance.ModalOpen("pause");
         }
     }
 }
Beispiel #12
0
 void OnInput(InputManager.Info data)
 {
     if (data.state == InputManager.State.Pressed)
     {
         Fsm.Event(onPressEvent);
     }
     else if (data.state == InputManager.State.Released)
     {
         Fsm.Event(onReleaseEvent);
     }
 }
Beispiel #13
0
 void OnInputJump(InputManager.Info dat)
 {
     if (dat.state == InputManager.State.Pressed)
     {
         mCtrl.Jump(true);
     }
     else if (dat.state == InputManager.State.Released)
     {
         mCtrl.Jump(false);
     }
 }
Beispiel #14
0
    void OnInputEscape(InputManager.Info data)
    {
        if (mInputLockCounter > 0)
        {
            return;
        }

        if (data.state == InputManager.State.Pressed)
        {
            UIModalManager.instance.ModalCloseTop();
        }
    }
    void OnInputInfo(InputManager.Info dat)
    {
        if (mLockInput)
        {
            return;
        }

        if (dat.state == InputManager.State.Pressed)
        {
            infoActiveGO.SetActive(!infoActiveGO.activeSelf);
        }
    }
Beispiel #16
0
 void OnInputSpecial(InputManager.Info dat)
 {
     /*if(dat.state == InputManager.State.Pressed) {
      *  if(bombGrabber.grabState == BombGrabber.GrabState.None) {
      *      int mode = (int)(bombGrabber.mode + 1);
      *      if(mode >= (int)BombGrabber.Mode.NumModes)
      *          mode = 0;
      *
      *      bombGrabber.mode = (BombGrabber.Mode)mode;
      *  }
      * }*/
 }
    void OnInput(InputManager.Info dat)
    {
        if (!mInputLock)
        {
            if (dat.state == InputManager.State.Pressed)
            {
                UIModalManager.instance.ModalCloseAll();

                //go to stage
                Main.instance.sceneManager.LoadScene(stages[mCurStage].level);
            }
        }
    }
Beispiel #18
0
 void OnInputPause(InputManager.Info dat)
 {
     if (dat.state == InputManager.State.Pressed)
     {
         if (state != (int)EntityState.Dead && state != (int)EntityState.Victory && state != (int)EntityState.Final)
         {
             if (UIModalManager.instance.activeCount == 0 && !UIModalManager.instance.ModalIsInStack("pause"))
             {
                 UIModalManager.instance.ModalOpen("pause");
             }
         }
     }
 }
Beispiel #19
0
 void OnInputSlide(InputManager.Info dat)
 {
     if (dat.state == InputManager.State.Pressed)
     {
         if (!mSliding)
         {
             Weapon curWpn = weapons[mCurWeaponInd];
             if ((!curWpn.isFireActive || curWpn.allowSlide) && mCtrl.isGrounded)
             {
                 SetSlide(true);
             }
         }
     }
 }
Beispiel #20
0
    void OnInput(InputManager.Info dat)
    {
        if (dat.state == InputManager.State.Pressed)
        {
            SetInput(false);

            if (!FsmEvent.IsNullOrEmpty(toEvent))
            {
                Fsm.Event(toEvent);
            }

            Finish();
        }
    }
Beispiel #21
0
    void OnInputJump(InputManager.Info dat)
    {
        if (dat.state == InputManager.State.Pressed)
        {
            InputManager input = Main.instance.input;

            Weapon curWpn = currentWeapon;
            if (curWpn == null || curWpn.Jump(this) == false)
            {
                if (!mSliding)
                {
                    if (input.GetAxis(0, InputAction.MoveY) < -0.1f && mCtrl.isGrounded)
                    {
                        if (!curWpn.isFireActive || curWpn.allowSlide)
                        {
                            SetSlide(true);
                        }
                    }
                    else
                    {
                        mCtrl.Jump(true);
                        if (mCtrl.isJumpWall)
                        {
                            Vector2 p = mCtrlSpr.wallStickParticle.transform.position;
                            PoolController.Spawn("fxp", "wallSpark", "wallSpark", null, p);
                            sfxWallJump.Play();
                        }
                    }
                }
                else
                {
                    if (input.GetAxis(0, InputAction.MoveY) >= 0.0f)
                    {
                        //if we can stop sliding, then jump
                        SetSlide(false, false);
                        if (!mSliding)
                        {
                            mCtrl.Jump(true);
                        }
                    }
                }
            }
        }
        else if (dat.state == InputManager.State.Released)
        {
            mCtrl.Jump(false);
        }
    }
Beispiel #22
0
    void OnInputJump(InputManager.Info dat)
    {
        if (!enabled)
        {
            return;
        }

        if (dat.state == InputManager.State.Pressed)
        {
            Jump(true);
        }
        else
        {
            Jump(false);
        }
    }
Beispiel #23
0
 void OnInput(InputManager.Info dat)
 {
     if (!UIModalManager.instance.ModalIsInStack(UIModalConfirm.modalName))
     {
         if (dat.state == InputManager.State.Pressed)
         {
             UIModalConfirm.Open(GameLocalize.GetText("skip_confirm_title"), GameLocalize.GetText("skip_confirm_desc"),
                                 delegate(bool yes) {
                 if (yes)
                 {
                     Main.instance.input.RemoveButtonCall(0, InputAction.MenuEscape, OnInput);
                     Player.instance.state = (int)EntityState.Final;
                 }
             });
         }
     }
 }
Beispiel #24
0
    void OnInputPowerPrev(InputManager.Info dat)
    {
        if (dat.state == InputManager.State.Pressed)
        {
            for (int i = 0, max = weapons.Length, toWeaponInd = currentWeaponIndex - 1; i < max; i++, toWeaponInd--)
            {
                if (toWeaponInd < 0)
                {
                    toWeaponInd = weapons.Length - 1;
                }

                if (weapons[toWeaponInd] && Weapon.IsAvailable(toWeaponInd))
                {
                    currentWeaponIndex = toWeaponInd;
                    break;
                }
            }
        }
    }
Beispiel #25
0
    void OnInputPowerNext(InputManager.Info dat)
    {
        if (dat.state == InputManager.State.Pressed)
        {
            for (int i = 0, max = weapons.Length, toWeaponInd = currentWeaponIndex + 1; i < max; i++, toWeaponInd++)
            {
                if (toWeaponInd >= weapons.Length)
                {
                    toWeaponInd = 0;
                }

                if (weapons[toWeaponInd] && SlotInfo.WeaponIsUnlock(toWeaponInd))
                {
                    currentWeaponIndex = toWeaponInd;
                    break;
                }
            }
        }
    }
Beispiel #26
0
    //input

    void OnInputFire(InputManager.Info dat)
    {
        if (dat.state == InputManager.State.Pressed)
        {
            if (currentWeapon)
            {
                if (currentWeapon.allowSlide || !mSliding)
                {
                    currentWeapon.FireStart();
                }
            }
        }
        else if (dat.state == InputManager.State.Released)
        {
            if (currentWeapon)
            {
                currentWeapon.FireStop();
            }
        }
    }
Beispiel #27
0
    void OnInput(InputManager.Info dat)
    {
        if (!UIModalManager.instance.ModalIsInStack(UIModalConfirm.modalName))
        {
            if (dat.state == InputManager.State.Pressed)
            {
                UIModalConfirm.Open(GameLocalize.GetText("skip_confirm_title"), GameLocalize.GetText("skip_confirm_desc"),
                                    delegate(bool yes) {
                    if (yes)
                    {
                        for (int i = 0; i < InputAction._count; i++)
                        {
                            Main.instance.input.RemoveButtonCall(0, i, OnInput);
                        }

                        Main.instance.sceneManager.LoadScene(toScene);
                    }
                });
            }
        }
    }
Beispiel #28
0
    void OnInputAction(InputManager.Info dat)
    {
        if (dat.state == InputManager.State.Pressed)
        {
            if (hasAttach)
            {
                if (!attachAnimator.isPlaying)
                {
                    attachAnimator.Play(mBodySpriteCtrl.isLeft ? "throwLeft" : "throw");
                }

                ThrowAttach();
            }
            else if (bombGrabber.canGrab)
            {
                bombGrabber.Grab();
            }
            else if (bombGrabber.grabState != BombGrabber.GrabState.None)
            {
                bombGrabber.Revert();
            }
        }
    }
Beispiel #29
0
        void OnInputEnter(InputManager.Info data)
        {
            bool pressed  = data.state == InputManager.State.Pressed;
            bool released = data.state == InputManager.State.Released;

            if (pressed || released)
            {
                UICamera.currentTouchID       = -666;
                UICamera.currentTouch         = mController;
                UICamera.currentTouch.current = UICamera.selectedObject;
                UICamera.eventHandler.ProcessTouch(pressed, released);
                UICamera.currentTouch.current = null;

                UICamera.currentTouch = null;
            }

            //UICamera.current
            //mController

            /* if(data.state == InputManager.State.Pressed && UICamera.selectedObject != null) {
             *   UICamera.Notify(UICamera.selectedObject, "OnClick", null);
             * }*/
        }
Beispiel #30
0
    void OnInputJump(InputManager.Info dat)
    {
        if (dat.state == InputManager.State.Pressed)
        {
            if (!mSliding)
            {
                InputManager input = Main.instance.input;

                if (input.GetAxis(0, InputAction.MoveY) < -0.1f && mCtrl.isGrounded)
                {
                    Weapon curWpn = weapons[mCurWeaponInd];
                    if (!curWpn.isFireActive || curWpn.allowSlide)
                    {
                        SetSlide(true);
                    }
                }
                else
                {
                    mCtrl.Jump(true);
                }
            }
            else
            {
                //if we can stop sliding, then jump
                SetSlide(false, false);
                if (!mSliding)
                {
                    mCtrl.Jump(true);
                }
            }
        }
        else if (dat.state == InputManager.State.Released)
        {
            mCtrl.Jump(false);
        }
    }