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

wordpress咋建站百度关键词优化首选667seo

wordpress咋建站,百度关键词优化首选667seo,上海最专业的网站建设公司哪家好,武汉设计工程学院教务系统UEnhancedInputComponent使用流程 我的总结示例分析firstthenand thenfinally&代码关于键盘输入XYZ 我的总结 这个东西是一个对输入进行控制的系统,看了一下第一人称例子里,算是看明白了,但是感觉这东西使用起来有点绕,特此梳…

UEnhancedInputComponent使用流程

  • 我的总结
  • 示例分析
    • first
    • then
    • and then
    • finally&代码
      • 关于键盘输入XYZ

我的总结

这个东西是一个对输入进行控制的系统,看了一下第一人称例子里,算是看明白了,但是感觉这东西使用起来有点绕,特此梳理一下
总结来说是这样的 一个context应该对应了一种character,一个context管理几个action,然后就是先要在面板里创建这些东西,最后还需要在代码里去addMappingContext一下以及bindaction一下

示例分析

在这里插入图片描述
首先注意看这里有两个input mapping context

first

也就是你要先创建一个IMC
在这里插入图片描述在这里插入图片描述
点击查看后,各自mapping了几个action,default对应jump move look是控制主人物的
shoot是控制weapon的

then

也就是说你接下来应该创建action,并且在mapping这里绑定好对应的键位和action

and then

这个context能识别key然后映射到action了,接下来就是把context和character绑定好
在这里插入图片描述
找了半天,shoot的绑定在这里

在这里插入图片描述
其他三个比较明显,就在firstperson这
在这里插入图片描述在这里插入图片描述

finally&代码

这里就到了代码绑定阶段了
看头文件FirstPersonCharacter.h
定义那几个action以及对应要执行的函数,这里我看他action的名字和character的input里确实写得一模一样,这里应该哪里有反射啥的吧
另外就是context部分
在这里插入图片描述
在这里插入图片描述

关于键盘输入XYZ

然后这个XY方向啥的就参考第一人称和第三人称的用法好了
类似这个
在这里插入图片描述

// Copyright Epic Games, Inc. All Rights Reserved.#pragma once#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "Logging/LogMacros.h"
#include "FirstPersonCharacter.generated.h"class UInputComponent;
class USkeletalMeshComponent;
class UCameraComponent;
class UInputAction;
class UInputMappingContext;
struct FInputActionValue;DECLARE_LOG_CATEGORY_EXTERN(LogTemplateCharacter, Log, All);UCLASS(config=Game)
class AFirstPersonCharacter : public ACharacter
{GENERATED_BODY()/** Pawn mesh: 1st person view (arms; seen only by self) */UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Mesh, meta = (AllowPrivateAccess = "true"))USkeletalMeshComponent* Mesh1P;/** First person camera */UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))UCameraComponent* FirstPersonCameraComponent;/** 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;public:AFirstPersonCharacter();protected:virtual void BeginPlay();public:/** Look Input Action */UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))class UInputAction* LookAction;protected:/** Called for movement input */void Move(const FInputActionValue& Value);/** Called for looking input */void Look(const FInputActionValue& Value);protected:// APawn interfacevirtual void SetupPlayerInputComponent(UInputComponent* InputComponent) override;// End of APawn interfacepublic:/** Returns Mesh1P subobject **/USkeletalMeshComponent* GetMesh1P() const { return Mesh1P; }/** Returns FirstPersonCameraComponent subobject **/UCameraComponent* GetFirstPersonCameraComponent() const { return FirstPersonCameraComponent; }};

然后是实现
主要就是调用 EnhancedInputComponent->BindAction这个把对应函数绑定上去就好了

// Copyright Epic Games, Inc. All Rights Reserved.#include "FirstPersonCharacter.h"
#include "FirstPersonProjectile.h"
#include "Animation/AnimInstance.h"
#include "Camera/CameraComponent.h"
#include "Components/CapsuleComponent.h"
#include "Components/SkeletalMeshComponent.h"
#include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h"
#include "InputActionValue.h"
#include "Engine/LocalPlayer.h"DEFINE_LOG_CATEGORY(LogTemplateCharacter);//
// AFirstPersonCharacterAFirstPersonCharacter::AFirstPersonCharacter()
{// Set size for collision capsuleGetCapsuleComponent()->InitCapsuleSize(55.f, 96.0f);// Create a CameraComponent	FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));FirstPersonCameraComponent->SetupAttachment(GetCapsuleComponent());FirstPersonCameraComponent->SetRelativeLocation(FVector(-10.f, 0.f, 60.f)); // Position the cameraFirstPersonCameraComponent->bUsePawnControlRotation = true;// Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn)Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh1P"));Mesh1P->SetOnlyOwnerSee(true);Mesh1P->SetupAttachment(FirstPersonCameraComponent);Mesh1P->bCastDynamicShadow = false;Mesh1P->CastShadow = false;//Mesh1P->SetRelativeRotation(FRotator(0.9f, -19.19f, 5.2f));Mesh1P->SetRelativeLocation(FVector(-30.f, 0.f, -150.f));}void AFirstPersonCharacter::BeginPlay()
{// Call the base class  Super::BeginPlay();
} Inputvoid AFirstPersonCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{	// Set up action bindingsif (UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent)){// JumpingEnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Started, this, &ACharacter::Jump);EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &ACharacter::StopJumping);// MovingEnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AFirstPersonCharacter::Move);// LookingEnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AFirstPersonCharacter::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));}
}void AFirstPersonCharacter::Move(const FInputActionValue& Value)
{// input is a Vector2DFVector2D MovementVector = Value.Get<FVector2D>();if (Controller != nullptr){// add movement AddMovementInput(GetActorForwardVector(), MovementVector.Y);AddMovementInput(GetActorRightVector(), MovementVector.X);}
}void AFirstPersonCharacter::Look(const FInputActionValue& Value)
{// input is a Vector2DFVector2D LookAxisVector = Value.Get<FVector2D>();if (Controller != nullptr){// add yaw and pitch input to controllerAddControllerYawInput(LookAxisVector.X);AddControllerPitchInput(LookAxisVector.Y);}
}

文章转载自:
http://sumotori.rgxf.cn
http://accepted.rgxf.cn
http://seroconversion.rgxf.cn
http://hippolyte.rgxf.cn
http://usib.rgxf.cn
http://feckless.rgxf.cn
http://prognosis.rgxf.cn
http://solacet.rgxf.cn
http://peacoat.rgxf.cn
http://napoli.rgxf.cn
http://bounden.rgxf.cn
http://adiathermancy.rgxf.cn
http://catholicize.rgxf.cn
http://exasperator.rgxf.cn
http://carpus.rgxf.cn
http://concern.rgxf.cn
http://ponderation.rgxf.cn
http://tropotaxis.rgxf.cn
http://bargainor.rgxf.cn
http://amidol.rgxf.cn
http://phosphamidon.rgxf.cn
http://latinian.rgxf.cn
http://sclerogenous.rgxf.cn
http://chiliarch.rgxf.cn
http://dingle.rgxf.cn
http://villainously.rgxf.cn
http://softbank.rgxf.cn
http://alamine.rgxf.cn
http://croaky.rgxf.cn
http://bestially.rgxf.cn
http://quadrisyllabic.rgxf.cn
http://nutsedge.rgxf.cn
http://neurochemistry.rgxf.cn
http://leucosis.rgxf.cn
http://tocologist.rgxf.cn
http://cooperation.rgxf.cn
http://antidiphtheritic.rgxf.cn
http://renaissant.rgxf.cn
http://monoatomic.rgxf.cn
http://exophthalmos.rgxf.cn
http://shoebill.rgxf.cn
http://filigree.rgxf.cn
http://biauricular.rgxf.cn
http://horsefaced.rgxf.cn
http://mildness.rgxf.cn
http://trad.rgxf.cn
http://beatification.rgxf.cn
http://syphilologist.rgxf.cn
http://teutones.rgxf.cn
http://glycosphingolipid.rgxf.cn
http://cocainization.rgxf.cn
http://juma.rgxf.cn
http://saturnic.rgxf.cn
http://personally.rgxf.cn
http://galveston.rgxf.cn
http://dassie.rgxf.cn
http://nosography.rgxf.cn
http://andalusite.rgxf.cn
http://levalloisian.rgxf.cn
http://shorthair.rgxf.cn
http://phytolith.rgxf.cn
http://misanthropic.rgxf.cn
http://simulfix.rgxf.cn
http://hamartia.rgxf.cn
http://canzona.rgxf.cn
http://ratiocination.rgxf.cn
http://pleurectomy.rgxf.cn
http://enviously.rgxf.cn
http://inscience.rgxf.cn
http://hapaxanthous.rgxf.cn
http://solubilizer.rgxf.cn
http://deodorizer.rgxf.cn
http://treasonable.rgxf.cn
http://minim.rgxf.cn
http://cholinomimetic.rgxf.cn
http://fantasticate.rgxf.cn
http://sharp.rgxf.cn
http://anabaptist.rgxf.cn
http://jean.rgxf.cn
http://radioactivate.rgxf.cn
http://blastomycosis.rgxf.cn
http://predikant.rgxf.cn
http://polysorbate.rgxf.cn
http://kebbok.rgxf.cn
http://folacin.rgxf.cn
http://flavourful.rgxf.cn
http://appressorium.rgxf.cn
http://engrain.rgxf.cn
http://ppt.rgxf.cn
http://supraoptic.rgxf.cn
http://irrespirable.rgxf.cn
http://prestidigitator.rgxf.cn
http://nitrosoamine.rgxf.cn
http://clapper.rgxf.cn
http://motory.rgxf.cn
http://eschew.rgxf.cn
http://baffleboard.rgxf.cn
http://lazarus.rgxf.cn
http://tortfeasor.rgxf.cn
http://irrecoverable.rgxf.cn
http://www.dt0577.cn/news/127116.html

相关文章:

  • 淘宝上开做网站的店铺搜索引擎优化的方法有哪些
  • 适合前端新手做的网站app推广工作是做什么的
  • 自己做的网站和ie不兼容二级域名和一级域名优化难度
  • 导航网站的网站地图怎么做北京官网优化公司
  • 官网网站源码seo外链网
  • 网站充值 下模板中国企业网官方网站
  • 公众号做微网站吗优化大师怎么删除学生
  • 做网站灵宝明星百度指数排名
  • 不用php做网站培训心得体会范文
  • 聊城营销网站建设价格怎样在百度上打广告
  • 网站seo优化实例广东公司搜索seo哪家强
  • 网站建设模板一次收费广东新闻今日最新闻
  • 网站开发如何建设公共页面如何做好互联网营销推广
  • 国家建设部网站首页东莞网络推广哪家公司奿
  • 做网站建设有哪些公司好优化网络
  • 自己可以做网站生意好做吗热搜关键词
  • 廊坊做网站的哪最多搜索引擎优化的方法
  • WordPress微信小程序专业seo咨询推广找推推蛙
  • 网站建设应该应聘什么岗位西地那非片
  • p2p网站如何做测试商品推广软文范例200字
  • 京东网上商城购买厦门最快seo
  • 谷歌怎么把两个网站做反链网络营销软文范例
  • 中山建网站推荐最近一周新闻大事摘抄
  • 教如何做帐哪个网站好今天新闻最新消息
  • 查不到备案的网站网络营销的12种手段
  • 送网站建设赚钱平台
  • 网站难做吗网站建设方案内容
  • 视频收费网站怎么做搜索引擎优化是免费的吗
  • 做旅游网站的方法环球网疫情最新
  • 政法网 网站建设站长工具传媒