Ejemplo n.º 1
0
    void FixedUpdate()
    {
        currentX = Input.GetAxisRaw("Horizontal");
        if (Mathf.Abs(previousX - currentX) > 0.0f)
        {
            createHorizontal = true;
        }
        previousX = currentX;

        if (createKys)
        {
            var action = new KysAction(cc);
            loopTracker.RegisterAction(action);
            action.PlayAction();
            createKys = false;
        }
        if (createHorizontal)
        {
            var action = new HorizontalAction(previousX, player);
            loopTracker.RegisterAction(action);
            action.PlayAction();
            createHorizontal = false;
        }

        if (createJump)
        {
            var action = new JumpAction(player, isJumpKeyDown);
            loopTracker.RegisterAction(action);
            action.PlayAction();
            createJump = false;
        }
    }
Ejemplo n.º 2
0
    public void StopMovement()
    {
        var action = new HorizontalAction(0.0f, player);

        loopTracker.RegisterAction(action);
        action.PlayAction();

        var action2 = new JumpAction(player, false);

        loopTracker.RegisterAction(action2);
        action2.PlayAction();
    }