Example #1
0
 public void OnGameEvent(PlayerInputGameEvent inputEvent)
 {
     if (!m_IsWaitingChoice && inputEvent.GetInput() == "Submit" && inputEvent.GetInputState() == EInputState.Down && m_IsInDialogue)
     {
         DisplayNextSentence();
     }
 }
Example #2
0
 public void OnGameEvent(PlayerInputGameEvent inputEvent)
 {
     if (inputEvent.GetInput() == "Pause" && inputEvent.GetInputState() == EInputState.Down && !UpdaterProxy.Get().IsPaused())
     {
         ChangeNextTransition(HSMTransition.EType.Child, typeof(GameFlowPauseState));
     }
 }
Example #3
0
 public void OnGameEvent(PlayerInputGameEvent inputEvent)
 {
     if (inputEvent.GetInput() == "Pause" && inputEvent.GetInputState() == EInputState.Down)
     {
         ChangeNextTransition(HSMTransition.EType.Exit);
     }
 }
Example #4
0
 public void OnGameEvent(PlayerInputGameEvent input)
 {
     if (input.GetInput() == "Escape")
     {
         gameObject.SetActive(true);
     }
 }
Example #5
0
 public void OnGameEvent(PlayerInputGameEvent inputEvent)
 {
     if (m_IsInDialogue && m_IsWaitingForInput)
     {
         string      input = inputEvent.GetInput();
         EInputState state = inputEvent.GetInputState();
         if (input == "Enter" && state == EInputState.Down)
         {
             m_IsWaitingForInput = false;
         }
     }
 }
Example #6
0
    public void OnGameEvent(PlayerInputGameEvent inputEvent)
    {
        if (UpdaterProxy.Get().IsPaused() || !m_ProcessInput)
        {
            return;
        }
        string      input = inputEvent.GetInput();
        EInputState state = inputEvent.GetInputState();

        switch (input)
        {
        case "Jump":
            if (state == EInputState.Down)
            {
                Jump();
            }
            break;

        case "Right":
            Move(state == EInputState.Held ? 1 : 0);
            ChangeFacingDirection(m_Right);
            break;

        case "Left":
            Move(state == EInputState.Held ? -1 : 0);
            ChangeFacingDirection(m_Left);
            break;

        case "Blast":
            if (state == EInputState.Down)
            {
                Fire();
            }
            break;

        case "Slash":
            if (state == EInputState.Down)
            {
                Slash();
            }
            break;

        default:
            break;
        }
    }
    public void OnGameEvent(PlayerInputGameEvent inputEvent)
    {
        string      input = inputEvent.GetInput();
        EInputState state = inputEvent.GetInputState();

        if (state != EInputState.Up)
        {
            switch (input)
            {
            case "Right":
                Move(true);
                break;

            case "Left":
                Move(false);
                break;

            default:
                break;
            }
        }
    }
Example #8
0
    public void OnGameEvent(PlayerInputGameEvent inputEvent)
    {
        if (UpdaterProxy.Get().IsPaused())
        {
            return;
        }

        string      input = inputEvent.GetInput();
        EInputState state = inputEvent.GetInputState();

        if (state == EInputState.Down)
        {
            switch (input)
            {
            case "TurnRight":
                AddTurnCommand((int)EFacingDirection.Right);
                break;

            case "TurnLeft":
                AddTurnCommand((int)EFacingDirection.Left);
                break;

            case "TurnUp":
                AddTurnCommand((int)EFacingDirection.Up);
                break;

            case "TurnDown":
                AddTurnCommand((int)EFacingDirection.Down);
                break;

            case "Grab / Ungrab":
                AddToggleGrabCommand();
                break;

            case "BinSpawnRequest":
                AddBinSpawnCommand();
                break;

            default:
                break;
            }
        }
        if (state == EInputState.Held || state == EInputState.Down)
        {
            switch (input)
            {
            case "Right":
                AddMoveCommand(1, 0);
                break;

            case "Left":
                AddMoveCommand(-1, 0);
                break;

            case "Up":
                AddMoveCommand(0, 1);
                break;

            case "Down":
                AddMoveCommand(0, -1);
                break;

            case "Undo":
                m_TimeHoldingUndo += Time.deltaTime;
                if (!m_IsUndoing && (m_TimeHoldingUndo > m_HeldUndoTreshold || state == EInputState.Down))
                {
                    StartCoroutine(Undo());
                }
                break;

            default:
                break;
            }
        }
        if (state == EInputState.Up && input == "Undo")
        {
            m_TimeHoldingUndo = 0f;
        }
    }