郁金香灬老师 游戏安全  驱动 逆向调试 C/C++编程  脚本 UE4/UE5

找回密码
立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
发新帖
课程大纲和价格
官方联系方式2024在线课大纲QQ咨询

34万

积分

123

好友

132

主题
发表于 2024-3-24 21:41:52 | 查看: 512| 回复: 0
  1. #include "Blueprint/UserWidget.h"
  2. #include "Components/Button.h"

  3. TArray<UUserWidget*> GetAllUserWidgets()
  4. {
  5.     TArray<UUserWidget*> UserWidgets;
  6.     UGameplayStatics::GetAllActorsOfClass(GetWorld(), UUserWidget::StaticClass(), UserWidgets);
  7.     return UserWidgets;
  8. }

  9. void TraverseUIButtons()
  10. {
  11.     TArray<UUserWidget*> AllWidgets = GetAllUserWidgets();
  12.     for (UUserWidget* Widget : AllWidgets)
  13.     {
  14.         TArray<UWidget*> AllChildren;
  15.         Widget->GetAllWidgets(AllChildren);

  16.         for (UWidget* ChildWidget : AllChildren)
  17.         {
  18.             if (UButton* Button = Cast<UButton>(ChildWidget))
  19.             {
  20.                 // 这里你可以对Button进行你需要的操作
  21.                 // 例如:Button->SetVisibility(ESlateVisibility::Collapsed);
  22.             }
  23.         }
  24.     }
  25. }
复制代码


游戏安全课程 学员办理咨询联系QQ150330575 手机 139 9636 2600  免费课程 在 www.bilibili.com 搜 郁金香灬老师
您需要登录后才可以回帖 登录 | 立即注册

QQ咨询

QQ|Archiver|手机版|小黑屋|郁金香游戏技术

GMT+8, 2024-4-27 14:40 , Processed in 0.083735 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表