UE4 SetVisibility()和SetHiddenInGame()的比较
void USceneComponent::SetVisibility(const bool bNewVisibility, const USceneComponent::EVisibilityPropagation PropagateToChildren)
{bool bRecurseChildren = (PropagateToChildren == EVisibilityPropagation::Propagate);if ( bNewVisibility != GetVisibleFlag() ){bRecurseChildren = bRecurseChildren || (PropagateToChildren == EVisibilityPropagation::DirtyOnly);SetVisibleFlag(bNewVisibility);OnVisibilityChanged();}const TArray<USceneComponent*>& AttachedChildren = GetAttachChildren();if (bRecurseChildren && AttachedChildren.Num() > 0){// fully traverse down the attachment tree// we do it entirely inline here instead of recursing in case a primitivecomponent is a child of a non-primitivecomponentTInlineComponentArray<USceneComponent*, NumInlinedActorComponents> ComponentStack;// prime the pumpComponentStack.Append(AttachedChildren);while (ComponentStack.Num() > 0){USceneComponent* const CurrentComp = ComponentStack.Pop(/*bAllowShrinking=*/ false);if (CurrentComp){ComponentStack.Append(CurrentComp->GetAttachChildren());if (PropagateToChildren == EVisibilityPropagation::Propagate){CurrentComp->SetVisibility(bNewVisibility, EVisibilityPropagation::NoPropagation);}// Render state must be dirtied if any parent component's visibility has changed. Since we can't easily track whether // any parent in the hierarchy was dirtied, we have to mark dirty always.CurrentComp->MarkRenderStateDirty();}}}
}
void USceneComponent::SetHiddenInGame(const bool bNewHiddenGame, const USceneComponent::EVisibilityPropagation PropagateToChildren)
{bool bRecurseChildren = (PropagateToChildren == EVisibilityPropagation::Propagate);if ( bNewHiddenGame != bHiddenInGame ){bRecurseChildren = bRecurseChildren || (PropagateToChildren == EVisibilityPropagation::DirtyOnly);bHiddenInGame = bNewHiddenGame;OnHiddenInGameChanged();}const TArray<USceneComponent*>& AttachedChildren = GetAttachChildren();if (bRecurseChildren && AttachedChildren.Num() > 0){// fully traverse down the attachment tree// we do it entirely inline here instead of recursing in case a primitivecomponent is a child of a non-primitivecomponentTInlineComponentArray<USceneComponent*, NumInlinedActorComponents> ComponentStack;// prime the pumpComponentStack.Append(AttachedChildren);while (ComponentStack.Num() > 0){USceneComponent* const CurrentComp = ComponentStack.Pop(/*bAllowShrinking=*/ false);if (CurrentComp){ComponentStack.Append(CurrentComp->GetAttachChildren());if (PropagateToChildren == EVisibilityPropagation::Propagate){CurrentComp->SetHiddenInGame(bNewHiddenGame, EVisibilityPropagation::NoPropagation);}// Render state must be dirtied if any parent component's visibility has changed. Since we can't easily track whether // any parent in the hierarchy was dirtied, we have to mark dirty always.CurrentComp->MarkRenderStateDirty();}}}
}
UE4 SetVisibility()和SetHiddenInGame()的比较相关推荐
- ue4渲染速度太慢_[UE4]性能优化指南(程序向)
封面来源:A Cold Stop(Mixer 制作材质.UE4渲染 ) [UE4]性能优化指南(美术向)玄冬Wong:[UE4]性能优化指南(美术向)zhuanlan.zhihu.com 内容都是处 ...
- UE4 C++ 笔记
文章目录 VS 编辑器 运行调试 VSCode VA 蓝图 Actor Component Pawn/Character And Controller AI 光照 数学 Other API UMG F ...
- ue4 4.24启动无响应_UE4项目问题集合
debugeditor模式下,在LoadPackage过程中crash,vs报出Stack overflow的错误 这是由于Package层数过多,vs栈不够用导致的.而ue4用UBT导致不能直接修改 ...
- ue4 曲线图实现 蓝图_UE4蓝图解析(一)
简介 蓝图是一类特殊的asset,可以使用直观.基于节点的方式创建逻辑,或者设置一些变量数据.策划可以创建自定义的Actor.Event.函数等等,快速的做Gameplay迭代,不需要写任何代码. 蓝 ...
- UE4材质着色器全面学习教程
你会学到什么 通过所有着色器类型和设计的实际演示,学习创建材质 要求 对虚幻的基本理解会有所帮助 了解纹理的一般知识(不仅限于UE4)也很有用 描述 在这个系列中,我将带你设置大量不同的材料,教你如何 ...
- UE4制作程序背景游戏 Make a game with Procedural Backgrounds in UE4
使用虚幻引擎4蓝图创建一个程序背景的游戏 你会学到什么 学习虚幻引擎4要领 使用程序切片创建标高 保存并加载某些游戏元素 创造一个无止境的跑步者角色 创建和完成游戏的良好习惯和实践 MP4 |视频:h ...
- UE4蓝图无代码编程游戏开发技能学习教程
在虚幻引擎4中创建.设计和开发自己的游戏,无需编码 你会学到什么 虚幻引擎4中使用蓝图的游戏开发(无代码编程) 使用行业标准方法的游戏设计 使用Maya进行三维设计 在本课程中创建您的第一个游戏 Ga ...
- UE4风格化场景设计入门指南 Stylized Station – The Environment Artist’s Survival Kit
持续时间13h 1920X1080 .ts 包含项目文件 大小解压后:4.9G 语言:英语+中文字幕(人工校对) 标题:风格化的车站--环境艺术家的生存工具包 信息: 环境艺术很难. 尤其是作为初学者 ...
- 在UE4中创建CG动画 How to create a movie in Unreal Engine 4 using Metahuman
MP4 |视频:h264,1280×720 |音频:AAC,44.1 KHz 语言:英语+中英文字幕(根据原英文字幕机译更准确)|大小解压后:1.55 GB |时长:1h 16m 你会学到什么 如何在 ...
最新文章
- IE8的parseInt
- 互联网技术架构的启示
- C++对C的加强之 “实用性”增加
- Keil4编译原子哥的SYSTEM出现错误 Inline assembler not permitted when generating Thumb code
- leetcode 542. 01 Matrix | 542. 01 矩阵(图解,广度优先搜索)
- 最全Pycharm教程
- 20应用统计考研复试要点(part31)--简答题
- SAP CRM WebClient UI上文本是否可编辑,取决于哪些条件
- phoenix Explain Plan 翻译
- AI 垃圾分类指日可待?
- SpringBoot2.0应用(五):SpringBoot2.0整合MyBatis
- idea编译器没有tomcat的选项解决方案
- jQuery:基础知识学习
- Excel怎么批量删除开头文本
- ios android 图文混排,[分享]iOS开发-50行代码实现图文混排
- VC++:菜单的使用总结
- 重启镜像DOCKER
- 赵小楼《天道》《遥远的救世主》深度解析(135)观念,传统观念,传统观念有没有用取决于观念,而不在传统
- Android四大组件Service之AIDL详解
- Ubuntu系统安装webrtc