Exemplo n.º 1
0
    protected override void OnUpdate()
    {
        Entities.ForEach((
                             ref C_Controller_Player cPlayerControl,
                             ref C_Ability_CanControlLateralMovement cControlMover) =>
        {
            cControlMover.normalizedLateralDir = MovementVectorCameraConverter.ConvertAndNormalizeInputVector(
                Input.GetAxisRaw("Walk_Vertical_P" + cPlayerControl.playerID),
                Input.GetAxisRaw("Walk_Horizontal_P" + cPlayerControl.playerID));
        });

        Entities.ForEach((
                             ref C_Controller_Player cPlayerControl,
                             ref C_Ability_CanJump cJumper) =>
        {
            cJumper.isAttemptingJump = Input.GetButtonDown("Jump_P" + cPlayerControl.playerID);
        });

        Entities.ForEach((
                             ref C_Controller_Player cPlayerControl,
                             ref C_Ability_CanHold cHolder) =>
        {
            cHolder.isAttemptingAction = Input.GetButtonDown("Hold_P" + cPlayerControl.playerID);
        });

        Entities.ForEach((
                             ref C_Controller_Player cPlayerControl,
                             ref C_Ability_CanAttack cAttack) =>
        {
            cAttack.isAttemptingAction = Input.GetButtonDown("Attack_P" + cPlayerControl.playerID);
        });
    }
Exemplo n.º 2
0
    void Update()
    {
        // Debug Text
        if (GameObject.Find("SceneControl").GetComponent <ConsoleCommand>().IsDebugVisible())
        {
            entity.SetDebugText("P" + playerNumber);
        }
        else
        {
            entity.SetDebugText("");
        }

        // Debug Invincible
        if (GameObject.Find("SceneControl").GetComponent <ConsoleCommand>().IsInvincible())
        {
            entity.ModifyHealth(1000);
        }

        // Jump Control
        if (Input.GetButtonDown("Jump_P" + playerNumber))
        {
            entity.CommandJump();
        }
        else
        {
            //entity.CommandTerminateJump();
        }

        // Attack Control
        if (Input.GetButtonDown("Attack_P" + playerNumber))
        {
            entity.CommandAttack();
        }

        // Movement Control
        entity.CommandSetMovementVector(
            MovementVectorCameraConverter.convertMovementVector(
                Input.GetAxisRaw("Walk_Vertical_P" + playerNumber),
                Input.GetAxisRaw("Walk_Horizontal_P" + playerNumber)));
    }
Exemplo n.º 3
0
 private void GetPanInput()
 {
     transform.position += MovementVectorCameraConverter.ConvertAndNormalizeInputVector(
         Input.GetAxisRaw("Walk_Vertical_P1"),
         Input.GetAxisRaw("Walk_Horizontal_P1")) * panSpeed / 20;
 }
Exemplo n.º 4
0
 private void GetPanInput()
 {
     transform.position += (MovementVectorCameraConverter.convertMovementVector(
                                Input.GetAxisRaw("Walk_Vertical_P1"),
                                Input.GetAxisRaw("Walk_Horizontal_P1"))) / 5;
 }