坑爹的SetCinematicMode--如何屏蔽用户输入的移动指令
来源:互联网 发布:php用iis和apache 编辑:程序博客网 时间:2024/05/21 08:38
游戏里,当角色在放大招,处于施放技能的状态中时,希望屏蔽掉用户输入中那些移动指令。否则角色的技能效果会因为角色的移动变形,或者角色在放大招时,就希望此时万千的指令皆空,惟有沉浸于此此时的大招。
UE已经提供了屏蔽用户输入的接口函数。
定义和实现都在PlayerController中:
void APlayerController::SetCinematicMode( bool bInCinematicMode, bool bAffectsMovement, bool bAffectsTurning);
void APlayerController::SetCinematicMode(bool bInCinematicMode, bool bHidePlayer, bool bAffectsHUD, bool bAffectsMovement, bool bAffectsTurning);
在Blueprint里可以用SetCinematicMode节点,是SetCinematicMode(bool bInCinematicMode, bool bHidePlayer, bool bAffectsHUD, bool bAffectsMovement, bool bAffectsTurning)这个函数。 而且,只能在Level Blueprint里使用。
SetCinematicMode里的几个参数如何设置,还真折腾浪费一些时间。以屏蔽Movement为例。
屏蔽Movement: bInCinematicMode = true, 且bAffectsMovement = true;
启用Movement::bInCinematicMode = false, 且bAffectsMovement = true。
这种搭配真奇葩。官方文档对这几个参数的解释也不清楚。 看源代码吧!
void APlayerController::SetCinematicMode( bool bInCinematicMode, bool bAffectsMovement, bool bAffectsTurning){ ///* 由此可知,bAffectsMovement必须保持为True,才有可能设置SetIgnoreMoveInput(...)。 搭配使用bCinemaDisableInputMove,才能有效地IgnoreMoveInput。 */if ( bAffectsMovement && (bInCinematicMode != bCinemaDisableInputMove) ){SetIgnoreMoveInput(bInCinematicMode);bCinemaDisableInputMove = bInCinematicMode;}if ( bAffectsTurning && (bInCinematicMode != bCinemaDisableInputLook) ){SetIgnoreLookInput(bInCinematicMode);bCinemaDisableInputLook = bInCinematicMode;}}
void APlayerController::SetCinematicMode(bool bInCinematicMode, bool bHidePlayer, bool bAffectsHUD, bool bAffectsMovement, bool bAffectsTurning){bCinematicMode = bInCinematicMode;// If we have a pawn we need to determine if we should show/hide the playerif (GetPawn() != NULL){// Only hide the pawn if in cinematic mode and we want toif (bCinematicMode && bHidePlayer){GetPawn()->SetActorHiddenInGame(true);}// Always safe to show the pawn when not in cinematic modeelse if (!bCinematicMode){GetPawn()->SetActorHiddenInGame(false);}}// Let the input system know about cinematic modeSetCinematicMode(bCinematicMode, bAffectsMovement, bAffectsTurning);// Replicate to the clientClientSetCinematicMode(bCinematicMode, bAffectsMovement, bAffectsTurning, bAffectsHUD);}
- 坑爹的SetCinematicMode--如何屏蔽用户输入的移动指令
- 屏蔽用户手动输入的代码或特殊字符处理
- 减少移动端用户的输入
- 如何控制用户的输入
- C# 给你一个移动联通电信的号段,你如何去判断用户输入的号码是哪个?
- excel 如何限定用户的输入范围
- web开发如何屏蔽浏览器输入框下拉历史的输入记录
- 在php中如何实现根据用户的操作系统语言和浏览器语言来屏蔽用户
- 可以屏蔽某些输入字符的TextBox
- Java密码屏蔽输入的实现方法
- 屏蔽input显示输入历史记录的方法
- JS 屏蔽非数字字符的输入
- Java密码屏蔽输入的实现方法
- 监听和屏蔽Enter键的输入
- 歪打正着;屏蔽网页里的输入;
- 如何屏蔽搜索引擎的文章!
- 如何屏蔽指定的网站
- JS获取按键的代码,Js如何屏蔽用户的按键
- mysql配置文件my.cnf详解
- 物联网时代:6款Linux家用智能设备
- OGNL表达式相关例子
- android中图库中选择视频
- 64 鸡兔同笼
- 坑爹的SetCinematicMode--如何屏蔽用户输入的移动指令
- 并查集
- C++ Class Size (C++ 类大小)
- ONLG表达式中做地址转换器
- 已命名的变量
- 分布式搜索elasticsearch配置文件详解
- COM原理(一)
- 消除字节对齐
- 解决DB之间且不同tablespace之间的数据导出导入操作(expdp和impdp)