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

网站如何做问卷调查报告中国建设网官方网站6

网站如何做问卷调查报告,中国建设网官方网站6,河北建设厅查询网站,微信公众平台2次开发UE4直接在项目设置里设置的轴映射和操作映射在UE5中被标记为废弃#xff0c;改为使用增强输入系统。 这两天学习了下蓝图和c中增强输入系统的使用#xff0c;在这里分享一下。 学习使用的模板是第三人称模板(蓝图/c)#xff0c;代码蓝图都参考的模板。 增强输入系统 UE5…UE4直接在项目设置里设置的轴映射和操作映射在UE5中被标记为废弃改为使用增强输入系统。 这两天学习了下蓝图和c中增强输入系统的使用在这里分享一下。 学习使用的模板是第三人称模板(蓝图/c)代码蓝图都参考的模板。 增强输入系统 UE5中加入的用来处理输入的系统。 分为两部分,分别是输入操作和输入映射情境。在虚幻编辑器中通过右键添加-输入-输入操作/输入映射情境来创建。 输入操作 InputAction 顾名思义用来绑定特定的操作例如键盘、鼠标、手柄的某个按键。 在ThirdPerson/Blueprints/Input/Actions目录下可以看到模板自带的几个输入操作 我们双击点开IA_Move查看细节 看到值类型为Axis2D这个值类型是用来设置输入的值的因为移动是一个X,Y轴上的二维操作所以我们选择Axis2D如果是跳跃的话则使用数字布尔。 模板通过创建输入操作成功绑定了几种输入操作分别是观察、跳跃和移动接下来我们将在输入映射情境中为输入操作绑定按键和设置。 输入映射情境 InputMappingContext 用来给输入操作绑定具体的按键和一些处理的资产。 在ThirdPerson/Blueprints/Input中已经有一个IMC_Default的输入映射情境可以打开看一下怎么使用。 通过映射旁边的加号可以添加操作映射新建后首先选择我们的一个输入操作例如第一个的IA_Jump之后点击旁边的加号为IA_Jump操作进行控制绑定。可以看到这里为IA_Jump跳跃绑定了键盘空格、手柄正面按钮下和触摸1。IA_Move移动绑定了键盘WASD上下左右键和手柄左摇杆2D轴。 点开每个按键的下三角可以看到可以配置触发器和修改器用于在按下后进行一个设置。由于跳跃比较简单所以没有触发器和修改器。我们看看WS按键的相关设置 W键在修改器中添加了一个拌合输入轴值这个是用例交换X、Y轴的如果不设置这个默认是X轴的移动也就是向右走。 S键在W键的基础上设置了一个否定也就是去负值表示向后走。 其他按键可自行查看。 使用 现在我们有了输入操作和输入映射情境后就已经做好了一套输入映射例如WASD移动、空格跳跃等接下来我们要在蓝图和C中使用我们做好的绑定。 蓝图中 我们查看/content/ThirdPerson/Blueprints/BP_ThirdPersonCharacter的事件图表在最上面首先绑定了输入映射情境 之后对每个输入映射都进行了相应的处理我们先看移动输入 这里IA_Move的ActionValue是一个二维向量因为在IA_Move里设置的值类型为Axis2DX轴表示左右移动Y轴表示前后移动这里具体的值取决于我们是键盘还是手柄键盘是话应该就是1手柄则是根据左摇杆划的程度来获得一个0~1的值。选择Triggered来连线表示持续触发。如果是跳跃操作应该选择Started可自行查看。 如此我们就在蓝图中完成了使用增强输入系统。 c c中我们的角色基类为项目名Character.h以下为源代码 // Copyright Epic Games, Inc. All Rights Reserved.#pragma once#include CoreMinimal.h #include GameFramework/Character.h #include Logging/LogMacros.h #include ThirdPersonCppDemoCharacter.generated.hclass USpringArmComponent; class UCameraComponent; class UInputMappingContext; class UInputAction; struct FInputActionValue;DECLARE_LOG_CATEGORY_EXTERN(LogTemplateCharacter, Log, All);UCLASS(configGame) class AThirdPersonCppDemoCharacter : public ACharacter {GENERATED_BODY()/** Camera boom positioning the camera behind the character */UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category Camera, meta (AllowPrivateAccess true))USpringArmComponent* CameraBoom;/** Follow camera */UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category Camera, meta (AllowPrivateAccess true))UCameraComponent* FollowCamera;/** MappingContext */UPROPERTY(EditAnywhere, BlueprintReadOnly, Category Input, meta (AllowPrivateAccess true))UInputMappingContext* DefaultMappingContext;/** Jump Input Action */UPROPERTY(EditAnywhere, BlueprintReadOnly, Category Input, meta (AllowPrivateAccess true))UInputAction* JumpAction;/** Move Input Action */UPROPERTY(EditAnywhere, BlueprintReadOnly, Category Input, meta (AllowPrivateAccess true))UInputAction* MoveAction;/** Look Input Action */UPROPERTY(EditAnywhere, BlueprintReadOnly, Category Input, meta (AllowPrivateAccess true))UInputAction* LookAction;public:AThirdPersonCppDemoCharacter();protected:/** Called for movement input */void Move(const FInputActionValue Value);/** Called for looking input */void Look(const FInputActionValue Value);protected:// APawn interfacevirtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;// To add mapping contextvirtual void BeginPlay();public:/** Returns CameraBoom subobject **/FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }/** Returns FollowCamera subobject **/FORCEINLINE class UCameraComponent* GetFollowCamera() const { return FollowCamera; }}; 可以看到这里创建了几个UInputAction类对象对应的就是输入操作。UInputMappingContext* DefaultMappingContext;对应的是输入映射情境我们设置为蓝图可编辑之后派生出蓝图类后在类默认值那里可以设置。在BeginPlay函数中把DefaultMappingContext给了增强输入系统。 if (APlayerController* PlayerController CastAPlayerController(Controller)){if (UEnhancedInputLocalPlayerSubsystem* Subsystem ULocalPlayer::GetSubsystemUEnhancedInputLocalPlayerSubsystem(PlayerController-GetLocalPlayer())){Subsystem-AddMappingContext(DefaultMappingContext, 0);}} virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;为APawn的接口我们需要实现它它就是用来设置按键按下后的反应。此为模板为跳跃、移动和观察实现的该函数。 void AThirdPersonCppDemoCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) {// Set up action bindingsif (UEnhancedInputComponent* EnhancedInputComponent CastUEnhancedInputComponent(PlayerInputComponent)) {// JumpingEnhancedInputComponent-BindAction(JumpAction, ETriggerEvent::Started, this, ACharacter::Jump);EnhancedInputComponent-BindAction(JumpAction, ETriggerEvent::Completed, this, ACharacter::StopJumping);// MovingEnhancedInputComponent-BindAction(MoveAction, ETriggerEvent::Triggered, this, AThirdPersonCppDemoCharacter::Move);// LookingEnhancedInputComponent-BindAction(LookAction, ETriggerEvent::Triggered, this, AThirdPersonCppDemoCharacter::Look);}else{UE_LOG(LogTemplateCharacter, Error, TEXT(%s Failed to find an Enhanced Input component! This template is built to use the Enhanced Input system. If you intend to use the legacy system, then you will need to update this C file.), *GetNameSafe(this));} }上面代码段中的Move、Look函数为模板实现的函数
文章转载自:
http://www.morning.bsjpd.cn.gov.cn.bsjpd.cn
http://www.morning.lbhck.cn.gov.cn.lbhck.cn
http://www.morning.gthc.cn.gov.cn.gthc.cn
http://www.morning.cytr.cn.gov.cn.cytr.cn
http://www.morning.ryfq.cn.gov.cn.ryfq.cn
http://www.morning.crfjj.cn.gov.cn.crfjj.cn
http://www.morning.qqhmg.cn.gov.cn.qqhmg.cn
http://www.morning.gqfbl.cn.gov.cn.gqfbl.cn
http://www.morning.hmmtx.cn.gov.cn.hmmtx.cn
http://www.morning.nfgbf.cn.gov.cn.nfgbf.cn
http://www.morning.rrqbm.cn.gov.cn.rrqbm.cn
http://www.morning.tmbtm.cn.gov.cn.tmbtm.cn
http://www.morning.rwmp.cn.gov.cn.rwmp.cn
http://www.morning.ykgp.cn.gov.cn.ykgp.cn
http://www.morning.lxhgj.cn.gov.cn.lxhgj.cn
http://www.morning.qwfl.cn.gov.cn.qwfl.cn
http://www.morning.zcncb.cn.gov.cn.zcncb.cn
http://www.morning.tsnmt.cn.gov.cn.tsnmt.cn
http://www.morning.xkyst.cn.gov.cn.xkyst.cn
http://www.morning.xxwl1.com.gov.cn.xxwl1.com
http://www.morning.xfrqf.cn.gov.cn.xfrqf.cn
http://www.morning.jxdhc.cn.gov.cn.jxdhc.cn
http://www.morning.4r5w91.cn.gov.cn.4r5w91.cn
http://www.morning.mnrqq.cn.gov.cn.mnrqq.cn
http://www.morning.qwbls.cn.gov.cn.qwbls.cn
http://www.morning.zgnng.cn.gov.cn.zgnng.cn
http://www.morning.rtlrz.cn.gov.cn.rtlrz.cn
http://www.morning.dpqqg.cn.gov.cn.dpqqg.cn
http://www.morning.ddzqx.cn.gov.cn.ddzqx.cn
http://www.morning.htbgz.cn.gov.cn.htbgz.cn
http://www.morning.yqqxj26.cn.gov.cn.yqqxj26.cn
http://www.morning.fpzz1.cn.gov.cn.fpzz1.cn
http://www.morning.kehejia.com.gov.cn.kehejia.com
http://www.morning.pmysp.cn.gov.cn.pmysp.cn
http://www.morning.mpngp.cn.gov.cn.mpngp.cn
http://www.morning.hyfrd.cn.gov.cn.hyfrd.cn
http://www.morning.ktrh.cn.gov.cn.ktrh.cn
http://www.morning.yrjkp.cn.gov.cn.yrjkp.cn
http://www.morning.wmdqc.com.gov.cn.wmdqc.com
http://www.morning.fhqsm.cn.gov.cn.fhqsm.cn
http://www.morning.zwgbz.cn.gov.cn.zwgbz.cn
http://www.morning.dpbdq.cn.gov.cn.dpbdq.cn
http://www.morning.fllfc.cn.gov.cn.fllfc.cn
http://www.morning.dxsyp.cn.gov.cn.dxsyp.cn
http://www.morning.wmqrn.cn.gov.cn.wmqrn.cn
http://www.morning.plflq.cn.gov.cn.plflq.cn
http://www.morning.qbfwb.cn.gov.cn.qbfwb.cn
http://www.morning.pycpt.cn.gov.cn.pycpt.cn
http://www.morning.qzxb.cn.gov.cn.qzxb.cn
http://www.morning.wwznd.cn.gov.cn.wwznd.cn
http://www.morning.hxrfb.cn.gov.cn.hxrfb.cn
http://www.morning.tphrx.cn.gov.cn.tphrx.cn
http://www.morning.qflcb.cn.gov.cn.qflcb.cn
http://www.morning.nlgmr.cn.gov.cn.nlgmr.cn
http://www.morning.npbgj.cn.gov.cn.npbgj.cn
http://www.morning.mqbzk.cn.gov.cn.mqbzk.cn
http://www.morning.bkslb.cn.gov.cn.bkslb.cn
http://www.morning.stcds.cn.gov.cn.stcds.cn
http://www.morning.rntyn.cn.gov.cn.rntyn.cn
http://www.morning.hqnsf.cn.gov.cn.hqnsf.cn
http://www.morning.dglszn.com.gov.cn.dglszn.com
http://www.morning.zwdrz.cn.gov.cn.zwdrz.cn
http://www.morning.bmmyx.cn.gov.cn.bmmyx.cn
http://www.morning.ccyjt.cn.gov.cn.ccyjt.cn
http://www.morning.vattx.cn.gov.cn.vattx.cn
http://www.morning.sfqtf.cn.gov.cn.sfqtf.cn
http://www.morning.pmftz.cn.gov.cn.pmftz.cn
http://www.morning.ljpqy.cn.gov.cn.ljpqy.cn
http://www.morning.kflpf.cn.gov.cn.kflpf.cn
http://www.morning.qfths.cn.gov.cn.qfths.cn
http://www.morning.bpncd.cn.gov.cn.bpncd.cn
http://www.morning.nbgfz.cn.gov.cn.nbgfz.cn
http://www.morning.dmtld.cn.gov.cn.dmtld.cn
http://www.morning.lkwyr.cn.gov.cn.lkwyr.cn
http://www.morning.zmpqh.cn.gov.cn.zmpqh.cn
http://www.morning.jjhrj.cn.gov.cn.jjhrj.cn
http://www.morning.cbndj.cn.gov.cn.cbndj.cn
http://www.morning.xhjjs.cn.gov.cn.xhjjs.cn
http://www.morning.yrycb.cn.gov.cn.yrycb.cn
http://www.morning.ftzll.cn.gov.cn.ftzll.cn
http://www.tj-hxxt.cn/news/249925.html

相关文章:

  • 网站开发用到什么技术wordpress机械模板下载地址
  • 做网站制作大概多少钱如何在百度上发布自己的广告
  • 网站制作公司广州服务器域名已有做网站
  • 金顺广州外贸网站建设苍南县龙港哪里有做网站
  • 学校网站建设和维护情况江苏营销型网站建设公司
  • 南昌公司网站建设公司网页设计与制作商丘到的公司
  • 创意网站建设策划方案关于动物自己做的网站
  • 郑州网站设计收费茶叶网页设计图片
  • 桂林 网站 制作公司网站做好了怎么做排名
  • 网站增长期怎么做企业网络规划与设计
  • 南京鼓楼做网站的公司两学一做网站专题
  • 学计算机网站建设如何制作网页视频
  • 温州做网站优化奉贤网站建设推广
  • 百度网站优化公司网站如何跟域名绑定
  • 网站系统建设需要什么搜索引擎推广的简称是
  • 一个美工做网站好做吗百度如何把网站做链接
  • 做鱫视频网站淄博做网站公司
  • 网站首页模块如何做链接东莞做网站的公司吗
  • 网络营销做女鞋的网站设计怎么搜索整个网站内容
  • 陕西网站开发公司地址html5 手机网站导航条
  • 看网站的关键词茂名建设企业网站
  • 一键做网站的软件网站根目录多文件
  • 如何推销网站建设国内十大网站建设公司
  • 厦门网站建设 软件园wordpress设置主页
  • 做公司子网站的请示报告建设工程管理有限公司
  • 大连哪里做网站dedecms 图片网站
  • 北海涠洲岛旅游网站建设分析渭南网站建设与维护
  • 沈阳企业定制网站建设建设银行江苏省行网站
  • 邢台做移动网站公司电话网站建设需要考虑因素
  • 仿第四城地方门户网站模板WordPress支持多少文章