Ejemplo n.º 1
0
    void BasicMovement()
    {
        Vector3 moveInputs = Vector3.zero;

        moveInputs.x = VirtualController.GetAxisHorizontal();
        moveInputs.z = VirtualController.GetAxisVertical();
        _anim.SetMoving(moveInputs.x != 0);
        _anim.SetFacing(moveInputs.x);
        if (UnlockTable.PowerActive(UnlockID.Crouch))
        {
            _anim.SetCrouchInput(moveInputs.z < 0);
        }

        if (moveInputs.x != 0 && _rigidbody.velocity.x != 0)
        {
            _rigidbody.velocity = new Vector3(0, _rigidbody.velocity.y);
        }

        Vector3 movement = CheckMovement(moveInputs);

        Vector3 movepos = transform.position;

        movepos.x += movement.x;
        //movepos.z += movement.z;

        transform.position = movepos;
    }