当前位置: 首页 > wzjs >正文

哪个网站做视频赚钱杭州最好的电商培训机构

哪个网站做视频赚钱,杭州最好的电商培训机构,seo属于什么职位类型,国外ip代理这一篇是进行玩家移动和视角移动的介绍。 1.在玩家内进行移动覆写 virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override; 2.创建增强输入资产的变量创建 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category "CharacterD…

这一篇是进行玩家移动和视角移动的介绍。

1.在玩家内进行移动覆写

virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;

2.创建增强输入资产的变量创建

UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "CharacterData", meta = (AllowPrivateAccess = "true"))UDA_InputConfig* InputConfigDataAsset;

3.进行移动和视角移动函数的创建

void Input_Move(const FInputActionValue& InputActionValue);void Input_Look(const FInputActionValue& InputActionValue);

4.在SetupPlayerInputComponent函数内进行输入绑定

//设置玩家输入组件
void AXMBCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{//添加映射上下文checkf(InputConfigDataAsset, TEXT("Forgot to assign a valid data as input config"))//获取本地玩家ULocalPlayer* LocalPlayer = GetController<APlayerController>()->GetLocalPlayer();//获取增强输入子系统UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(LocalPlayer);check(Subsystem);//添加映射上下文Subsystem->AddMappingContext(InputConfigDataAsset->DefaultMappingContext,0);//获取角色输入组件并绑定输入动作UXMBWarriorInputComponent* WarriorInputComponent = CastChecked<UXMBWarriorInputComponent>(PlayerInputComponent);WarriorInputComponent->BindNativeInputAction(InputConfigDataAsset,XMBGameplayTags::InputTag_Move, ETriggerEvent::Triggered,this,&ThisClass::Input_Move);WarriorInputComponent->BindNativeInputAction(InputConfigDataAsset,XMBGameplayTags::InputTag_Look, ETriggerEvent::Triggered,this,&ThisClass::Input_Look);}

5.对Move函数进行设置

void AXMBCharacter::Input_Move(const FInputActionValue& InputActionValue)
{//获取移动向量const FVector2D MovementVector = InputActionValue.Get<FVector2D>();//获取移动旋转const FRotator MovementRotation(0.f, Controller->GetControlRotation().Yaw, 0.f);//处理前后移动if (MovementVector.Y != 0.f){const FVector ForwardDirection = MovementRotation.RotateVector(FVector::ForwardVector);AddMovementInput(ForwardDirection, MovementVector.Y);}//处理左右移动if (MovementVector.X != 0.f){const FVector RightDirection = MovementRotation.RotateVector(FVector::RightVector);AddMovementInput(RightDirection, MovementVector.X);}}

6.对视角移动函数进行设置

void AXMBCharacter::Input_Look(const FInputActionValue& InputActionValue)
{const FVector2D LookAxisVector = InputActionValue.Get<FVector2D>();if (LookAxisVector.X != 0.f){AddControllerYawInput(LookAxisVector.X);}if (LookAxisVector.Y != 0.f){AddControllerPitchInput(LookAxisVector.Y);}
}

7.打开引擎,进入角色蓝图,细节面板搜索data,更换成自己的dataasset

#include "Character/XMBCharacter.h"
#include "Components/CapsuleComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "Camera/CameraComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "EnhancedInputSubsystems.h"
#include "Data/Input/DA_InputConfig.h"
#include "Components/Input/XMBWarriorInputComponent.h"
#include "XMBGameplayTags.h"#include "XMBDebugHelper.h"AXMBCharacter::AXMBCharacter()
{GetCapsuleComponent()->InitCapsuleSize(42.f, 96.f);bUseControllerRotationPitch = false;bUseControllerRotationYaw = false;bUseControllerRotationRoll = false;CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));CameraBoom->SetupAttachment(GetRootComponent());CameraBoom->TargetArmLength = 300.0f;CameraBoom->SocketOffset = FVector(0.0f, 55.0f, 60.0f);CameraBoom->bUsePawnControlRotation = true;FollowCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera"));FollowCamera->SetupAttachment(CameraBoom, USpringArmComponent::SocketName);FollowCamera->bUsePawnControlRotation = false;GetCharacterMovement()->bOrientRotationToMovement = true;GetCharacterMovement()->RotationRate = FRotator(0.0f, 550.0f, 0.0f);GetCharacterMovement()->MaxWalkSpeed = 400.f;GetCharacterMovement()->BrakingDecelerationWalking = 2000.f;}void AXMBCharacter::BeginPlay()
{Super::BeginPlay();Debug::Print(FString::Printf(TEXT("XMBCharacter::BeginPlay")));
}//设置玩家输入组件
void AXMBCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{//添加映射上下文checkf(InputConfigDataAsset, TEXT("Forgot to assign a valid data as input config"))//获取本地玩家ULocalPlayer* LocalPlayer = GetController<APlayerController>()->GetLocalPlayer();//获取增强输入子系统UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(LocalPlayer);check(Subsystem);//添加映射上下文Subsystem->AddMappingContext(InputConfigDataAsset->DefaultMappingContext,0);//获取角色输入组件并绑定输入动作UXMBWarriorInputComponent* WarriorInputComponent = CastChecked<UXMBWarriorInputComponent>(PlayerInputComponent);WarriorInputComponent->BindNativeInputAction(InputConfigDataAsset,XMBGameplayTags::InputTag_Move, ETriggerEvent::Triggered,this,&ThisClass::Input_Move);WarriorInputComponent->BindNativeInputAction(InputConfigDataAsset,XMBGameplayTags::InputTag_Look, ETriggerEvent::Triggered,this,&ThisClass::Input_Look);}void AXMBCharacter::Input_Move(const FInputActionValue& InputActionValue)
{//获取移动向量const FVector2D MovementVector = InputActionValue.Get<FVector2D>();//获取移动旋转const FRotator MovementRotation(0.f, Controller->GetControlRotation().Yaw, 0.f);//处理前后移动if (MovementVector.Y != 0.f){const FVector ForwardDirection = MovementRotation.RotateVector(FVector::ForwardVector);AddMovementInput(ForwardDirection, MovementVector.Y);}//处理左右移动if (MovementVector.X != 0.f){const FVector RightDirection = MovementRotation.RotateVector(FVector::RightVector);AddMovementInput(RightDirection, MovementVector.X);}// if (MovementVector.Z != 0.f)// {// 	const FVector RightDirection = MovementRotation.RotateVector(FVector::UpVector);//// 	AddMovementInput(RightDirection, MovementVector.Z);// }}void AXMBCharacter::Input_Look(const FInputActionValue& InputActionValue)
{const FVector2D LookAxisVector = InputActionValue.Get<FVector2D>();if (LookAxisVector.X != 0.f){AddControllerYawInput(LookAxisVector.X);}if (LookAxisVector.Y != 0.f){AddControllerPitchInput(LookAxisVector.Y);}
}
// Fill out your copyright notice in the Description page of Project Settings.#pragma once#include "CoreMinimal.h"
#include "InputActionValue.h"
#include "Character/CharacterBase.h"
#include "XMBCharacter.generated.h"class UDA_InputConfig;
class UCameraComponent;
class USpringArmComponent;
struct FInputActionValue;
/*** */
UCLASS()
class ARPG_GRIVITY_API AXMBCharacter : public ACharacterBase
{GENERATED_BODY()
public:AXMBCharacter();protected:virtual void BeginPlay() override;virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;private:UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera", meta = (AllowPrivateAccess = "true"))USpringArmComponent* CameraBoom;UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera", meta = (AllowPrivateAccess = "true"))UCameraComponent* FollowCamera;//UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "CharacterData", meta = (AllowPrivateAccess = "true"))UDA_InputConfig* InputConfigDataAsset;void Input_Move(const FInputActionValue& InputActionValue);void Input_Look(const FInputActionValue& InputActionValue);};

http://www.dtcms.com/wzjs/136074.html

相关文章:

  • 武汉专业手机网站建设网络营销工具包括
  • 电子商务网站建设期末考试网站怎么快速收录
  • 网站建设教程pptseo站长网
  • 网站建设开发文档活动推广
  • 丹徒区建设局网站网络推广员
  • pc网站开发语言市场调研报告
  • 丽水微信网站建设报价新闻头条最新消息今日头条
  • 公司漏沟设计logo免费旺道seo优化软件
  • 网站的总规划书sem营销推广
  • 上海宣传片拍摄制作公司北京优化靠谱的公司
  • 如何做企业网站电商软文广告经典案例
  • 广告行业网站建设方案九江seo公司
  • 天津进出口企业名录上海网站关键词排名优化报价
  • 房山营销型网站制作开发百度知道登录入口
  • 代加工接订单网站seo排名点击器原理
  • 佛山从事网站建设策划公司
  • 请别人做网站会不会被盗百度seo和sem
  • java购物网站扫码支付怎么做重庆seo排名电话
  • 公司建网站的步骤是什么中国时事新闻网
  • 大同网站建设推广友情链接买卖平台
  • 云服务器里面做网站播放器seo排名软件免费
  • 广州专业的网站建设公司哪家好网站优化关键词价格
  • 做网站建设小程序手机网站关键词快速排名
  • 网站改版怎么弄自动推广工具
  • 免费生成手机网站如何进行搜索引擎优化 简答案
  • 南和住房和城乡建设局网站html网页模板
  • 商务网站开发心得网站整站优化推广方案
  • 中国房地产网站链接搜索引擎
  • 发布信息的网站站长是什么级别
  • php网站源码架构seo排名优化软件免费