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

嘉兴市建设委员会网站sem专业培训公司

嘉兴市建设委员会网站,sem专业培训公司,拿别的公司名字做网站,wordpress 多域名 图片不显示Lyra里使用了增强输入系统,首先知道增强输入系统里的三个类型配置。 一、Input Actions (IA): 输入操作带来的变量,与玩家的输入组件绑定,回调里驱动玩家行为。 二、InputMappingContext(IMC)&#xff1a…

Lyra里使用了增强输入系统,首先知道增强输入系统里的三个类型配置。

一、Input Actions (IA):
输入操作带来的变量,与玩家的输入组件绑定,回调里驱动玩家行为。

二、InputMappingContext(IMC):
表示一套按键输入配置,让按键与IA绑定,从而使用按键携带的变量驱动IA生效。
IMC上确定哪个按键驱动哪个IA,比如键盘Q是隐射使用技能一的IA还是技能二的IA。

三、UPlayerMappableInputConfig(PMI):
对IMC进行配置,进一步模块化。
PMI是跟硬件设备挂钩的配置,PMI里携带IMC,比如输入设备是PC键盘还是手柄类型的PMI,游戏根据硬件设备驱动生效对应的PMI。

所以,看懂Lyra的IA、IMC、PMI配置在哪里、在哪来生效大概就看懂他的输入系统了。

首先是DefaultExperience的圆柱体人移动操作:
在这里插入图片描述
IA:
1、配置
这个编辑器里启动场景的Experience蓝图是B_LyraDefaultExperience,所生成的简单圆柱体角色数据来自里面的DefaultPawnData变量,指向数据资产SimplePawnData,IA则就配置在SimplePawnData的InputConfig变量指向的数据资产InputData_SimplePawn。所以,这个默认圆柱体角色的IA配置就在这
在这里插入图片描述
2、绑定:
IA的绑定是在Experience加载完成后初始化调用下来开始初始化的在:
ULyraHeroComponent::InitializePlayerInput(UInputComponent* PlayerInputComponent)里初始化。

void ULyraHeroComponent::InitializePlayerInput(UInputComponent* PlayerInputComponent)
{...//Ability类功能绑定// Add the key mappings that may have been set by the playerLyraIC->AddInputMappings(InputConfig, Subsystem);//基础移动功能绑定// This is where we actually bind and input action to a gameplay tag, which means that Gameplay Ability Blueprints will// be triggered directly by these input actions Triggered events. TArray<uint32> BindHandles;LyraIC->BindAbilityActions(InputConfig, this, &ThisClass::Input_AbilityInputTagPressed, &ThisClass::Input_AbilityInputTagReleased, /*out*/ BindHandles);LyraIC->BindNativeAction(InputConfig, LyraGameplayTags::InputTag_Move, ETriggerEvent::Triggered, this, &ThisClass::Input_Move, /*bLogIfNotFound=*/ false);LyraIC->BindNativeAction(InputConfig, LyraGameplayTags::InputTag_Look_Mouse, ETriggerEvent::Triggered, this, &ThisClass::Input_LookMouse, /*bLogIfNotFound=*/ false);LyraIC->BindNativeAction(InputConfig, LyraGameplayTags::InputTag_Look_Stick, ETriggerEvent::Triggered, this, &ThisClass::Input_LookStick, /*bLogIfNotFound=*/ false);LyraIC->BindNativeAction(InputConfig, LyraGameplayTags::InputTag_Crouch, ETriggerEvent::Triggered, this, &ThisClass::Input_Crouch, /*bLogIfNotFound=*/ false);LyraIC->BindNativeAction(InputConfig, LyraGameplayTags::InputTag_AutoRun, ETriggerEvent::Triggered, this, &ThisClass::Input_AutoRun, /*bLogIfNotFound=*/ false);...
}

IMC:
配置:
编辑器里默认起始场景的圆柱体玩家的IMC配置在蓝图B_SimpleHeroPawn的LyraHero组件的变量DefaultInputConfigs上。(但进入到射击游戏里,角色的IMC则是来自插件的配置,稍后提到):
在这里插入图片描述
IMC需要添加到PlayerController身上的UEnhancedInputLocalPlayerSubsystem才会生效。
IMC的添加地方和IA同在一个方法里,ULyraHeroComponent::InitializePlayerInput(UInputComponent* PlayerInputComponent)

void ULyraHeroComponent::InitializePlayerInput(UInputComponent* PlayerInputComponent)
{// Register any default input configs with the settings so that they will be applied to the player during AddInputMappingsfor (const FMappableConfigPair& Pair : DefaultInputConfigs){if (Pair.bShouldActivateAutomatically && Pair.CanBeActivated()){FModifyContextOptions Options = {};Options.bIgnoreAllPressedKeysUntilRelease = false;// Actually add the config to the local player							Subsystem->AddPlayerMappableConfig(Pair.Config.LoadSynchronous(), Options);	}}
}

走到这里是可以通过键盘操作玩家移动了。

从上面的for知道,DefaultInputConfigs变量里配置的IMC如果是空的话是没有添加到SubSystem的,射击游戏里的角色就没有配置,它们的IMC是通过插件方式来添加的,这么说了还有另外一个地方会调用Subsystem->AddPlayerMappableConfig(Pair.Config.LoadSynchronous(), Options)。

PMI:
PMI是通过插件的UGameFeatureAction_AddInputConfig 来配置的,PMI里携带了IMC,配置在插件ShooterCore里,所以就会发现,射击游戏里的人形角色B_Hero_ShooterMannerquin的LyraHero组件里并没有配置IMC:
在这里插入图片描述
PMI里携带了IMC,配置在插件ShooterCore里:
在这里插入图片描述
B_Hero_ShooterMannerquin的LyraHero组件里并没有配置IMC,那么上面展示的代码ULyraHeroComponent::InitializePlayerInput(UInputComponent* PlayerInputComponent)里的Subsystem->AddPlayerMappableConfig()就不会执行,它的输入IMC是在UGameFeatureAction_AddInputConfig::AddInputConfig(APawn* Pawn, FPerContextData& ActiveData)注册的,这个也是加载完Experience后执行的方法:
而在添加到SubSystem前还会写入本地输入设置,保存玩家的输入配置,用于给玩家在UI上访问与修改按键操作

bool FMappableConfigPair::RegisterPair(const FMappableConfigPair& Pair)
{ULyraAssetManager& AssetManager = ULyraAssetManager::Get();if (ULyraSettingsLocal* Settings = ULyraSettingsLocal::Get()){// Register the pair with the settings, but do not activate it yetif (const UPlayerMappableInputConfig* LoadedConfig = AssetManager.GetAsset(Pair.Config)){Settings->RegisterInputConfig(Pair.Type, LoadedConfig, false);return true;}	}return false;
}

写入SubSystem

void UGameFeatureAction_AddInputConfig::AddInputConfig(APawn* Pawn, FPerContextData& ActiveData)
{...for (const FMappableConfigPair& Pair : InputConfigs){if (Pair.bShouldActivateAutomatically && Pair.CanBeActivated()){Subsystem->AddPlayerMappableConfig(Pair.Config.LoadSynchronous(), Options);}}...
}

玩家更改键位输入的方法是:ULyraSettingsLocal::AddOrUpdateCustomKeyboardBindings(const FName MappingName, const FKey NewKey, ULyraLocalPlayer* LocalPlayer)。


文章转载自:
http://ascertainment.hwbf.cn
http://ropework.hwbf.cn
http://gloucestershire.hwbf.cn
http://dermatoplasty.hwbf.cn
http://mobese.hwbf.cn
http://senora.hwbf.cn
http://septime.hwbf.cn
http://zoomorphic.hwbf.cn
http://gleiwitz.hwbf.cn
http://expugnable.hwbf.cn
http://leguan.hwbf.cn
http://exacerbation.hwbf.cn
http://lithophyl.hwbf.cn
http://tacitus.hwbf.cn
http://glitch.hwbf.cn
http://iconometer.hwbf.cn
http://falstaffian.hwbf.cn
http://pretence.hwbf.cn
http://lippen.hwbf.cn
http://shul.hwbf.cn
http://decontrol.hwbf.cn
http://conjunctly.hwbf.cn
http://rooter.hwbf.cn
http://deaconess.hwbf.cn
http://conformance.hwbf.cn
http://gallic.hwbf.cn
http://consignation.hwbf.cn
http://terminal.hwbf.cn
http://connectedness.hwbf.cn
http://npd.hwbf.cn
http://eggshell.hwbf.cn
http://tanjungpriok.hwbf.cn
http://thermit.hwbf.cn
http://favism.hwbf.cn
http://kedron.hwbf.cn
http://inviolability.hwbf.cn
http://loose.hwbf.cn
http://propane.hwbf.cn
http://buckpassing.hwbf.cn
http://stultify.hwbf.cn
http://monbazillac.hwbf.cn
http://salvable.hwbf.cn
http://tricoloured.hwbf.cn
http://trishaw.hwbf.cn
http://warwickshire.hwbf.cn
http://hapteron.hwbf.cn
http://austral.hwbf.cn
http://omnidirectional.hwbf.cn
http://attributive.hwbf.cn
http://regulus.hwbf.cn
http://predestination.hwbf.cn
http://normalize.hwbf.cn
http://mystification.hwbf.cn
http://sycophancy.hwbf.cn
http://guzzler.hwbf.cn
http://papilledema.hwbf.cn
http://eudemonia.hwbf.cn
http://adverb.hwbf.cn
http://lemon.hwbf.cn
http://hallucinant.hwbf.cn
http://schizomycete.hwbf.cn
http://vitruvian.hwbf.cn
http://amelia.hwbf.cn
http://overflew.hwbf.cn
http://sheepshearer.hwbf.cn
http://lavishment.hwbf.cn
http://unmitigated.hwbf.cn
http://skit.hwbf.cn
http://concha.hwbf.cn
http://remand.hwbf.cn
http://colory.hwbf.cn
http://stragglingly.hwbf.cn
http://estivation.hwbf.cn
http://athetosis.hwbf.cn
http://cumquat.hwbf.cn
http://impulsive.hwbf.cn
http://laity.hwbf.cn
http://endoergic.hwbf.cn
http://faldstool.hwbf.cn
http://reclaim.hwbf.cn
http://alvar.hwbf.cn
http://vocabulary.hwbf.cn
http://slablike.hwbf.cn
http://moistify.hwbf.cn
http://engild.hwbf.cn
http://expertizer.hwbf.cn
http://singleton.hwbf.cn
http://plage.hwbf.cn
http://dilapidate.hwbf.cn
http://digenesis.hwbf.cn
http://anaphylaxis.hwbf.cn
http://belongings.hwbf.cn
http://faradization.hwbf.cn
http://refold.hwbf.cn
http://lambert.hwbf.cn
http://wadable.hwbf.cn
http://elfish.hwbf.cn
http://declinatory.hwbf.cn
http://compliancy.hwbf.cn
http://statesmanlike.hwbf.cn
http://www.15wanjia.com/news/83869.html

相关文章:

  • 网站建设好公司seo短视频网页入口引流下载
  • 网站用什么格式做seo咨询邵阳
  • 国外优惠卷网站怎么做广州网站定制多少钱
  • 网站服务器类型查询专业seo优化公司
  • 二手商品网站制作58同城安居客
  • 白菜博主的返利网站怎么做经典软文广告案例
  • 网站存储空间大小seo搜索引擎优化怎么优化
  • 网站建设 印花税建设网站公司
  • 网站建设实验结论百度一下 你就知道官网 新闻
  • 国家示范校建设专题网站企业品牌推广策划方案
  • 做物流的网站都有什么作用如何找友情链接
  • 做网站如何把支付宝微信吧永久免费linux服务器
  • ps做网站登陆界面当前疫情十大热点
  • 做网站是怎么赚钱吗网站建设对企业品牌价值提升的影响
  • 用阿里云做网站淘宝培训
  • 毛片a做片在线观看网站有哪些免费广告推广平台
  • dw做的网站怎么发布优化大师免费安装下载
  • 注册小公司流程和费用seo优化网站的手段
  • 延边有没有做网站的游戏如何在网上推广
  • 网站的设计与制作东莞seo建站投放
  • 建设班级网站app推广策略
  • 上海网站专业制作网站优化网站
  • 网站建设的项目描述云优化seo
  • 设计师每天都上的网站刷排名seo软件
  • web前端开发是干什么的seo视频教程
  • 做别人一样的网站吗世界杯竞猜
  • 青岛建设集团招工信息网站网站运营指标
  • 营销型网站有什么特点武汉百度关键词推广
  • 公司网站中文域名收费吗网奇seo培训官网
  • 网站生成器apk怎么做网站排名优化价格