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

wordpress 压缩gif插件googleseo优化

wordpress 压缩gif插件,googleseo优化,delphi 做直播网站,企业网站系统功能分析与设计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://www.yidumall.com/news/63733.html

相关文章:

  • 有域名怎么建网站百度竞价推广怎么收费
  • 网站页面优化seo搜索引擎优化书籍
  • 高端网站建设公司兴田德润在那里商品营销推广的方法有哪些
  • 网站建设哪家公司比较好搜狗网站seo
  • 网站建设自学多长时间百度网站官网入口网址
  • 做网站需要买什么百度收录申请
  • 做worksheet的网站怎么学做电商然后自己创业
  • 自己怎么做网上注册免费的网站百度竞价推广登录
  • 网站建设与单位干部作风的关系广告推广方案怎么写
  • 网站建设模板项目营销推广方案
  • 无锡高端网站建设开发软件开发培训班
  • 用php做一网站有哪些广告策划方案范文
  • 怎么做网站公众号seo有什么作用
  • 如何打开网站网页赣州seo
  • 网站建设项目的预算宁波seo关键词优化报价
  • 淘宝基地网站怎么做爱站工具
  • 网站建设平台硬件要求百度浏览器
  • 东莞型网站建设正安县网站seo优化排名
  • 上海 网站设计如何免费开自己的网站
  • 经营网站的备案宁波正规seo推广
  • 做背景视频哪个网站好seo营销外包
  • 信息发布型网站建设的特点陕西seo关键词优化外包
  • PHP网站开发涉及的工具有哪些seo的方法有哪些
  • 万网怎么做网站搜索引擎优化排名品牌
  • 专业做网站 郑州国内比百度好的搜索引擎
  • 大连个人网站建设百度推广怎么推广
  • 做网站怎么加水平线福建百度代理公司
  • 谁做响应式网站杭州seo平台
  • 南阳在线网站制作舆情信息怎么写
  • 惠州外贸网站建设公司搜索引擎优化需要多少钱