更新控件(Widget)文字 接着将DisplayName的值实际应用到NameBoard上。将NameBoard组件拖到事件图表(Event Graph)中,获取控件(Get Widget)来取得该组件中我们配置的控件的实例,将该实例转换为(Cast To)WBP_NameBoard,从而取到WBP_NameBoard中的TextBlock_Name,设置文本(Set Text)中In Text传入DisplayName的值。这样...
添加一个碰撞组件(例如:Sphere Collision)。 在碰撞组件的OnComponentBeginOverlap事件中,使用Cast To BP_Character节点确认其他物件是角色蓝图的实例。 调用角色的IncreaseHealth函数,并传递一个值(例如,HealthAmount变量)。 Event OnComponentBeginOverlap (Other Actor) Cast To BP_Character (Other Actor) Is Valid?
创建第一个blueprint工程 将静态网格转换成蓝图类 Convert Selection to Blueprint Class 给方块添加Box,点击Add 搜索Box 添加事件 组件重叠 Events ->On Component Begin Overlap 监听Cast To 重叠的发生 让方块位置从-45降至-35 添加移动节点组件 Move Component To 取出静态网格组件 获取静态网格位置->添加向量 G...
checkf(OverlayWidgetControllerClass, TEXT("OverlayWidgetControllerClass 未设置,请在HUD上面设置")); UMyUserWidget* Widget = CreateWidget<UMyUserWidget>(GetWorld(), OverlayWidgetClass); //创建Overlay用户控件 OverlayWidget = Cast<UMyUserWidget>(Widget); const FWidgetControllerParams WidgetControllerParams(...
UWidgetComponent* My3DUI; 2、然后再在构造函数中加载2.1创建的蓝图,代码如下:其中“"/Script/UMGEditor.WidgetBlueprint'/Game/BluePrint/UI3D.UI3D_C'"为2.1中创建的蓝图的引用,注意后面一定要加上后缀”_C“。 My3DUI = CreateDefaultSubobject(TEXT("My3DUI")); ...
转换成需要的类型, CastField<FTargetTypeProperty>(FProperty) 然后通过FProperty的内置函数把参数读出来FTargetTypeProperty->GetPropertyValue_InContainer(Target) 这边需要注意FProperty是4.25以后版本中对外暴露的项取代了之前的UProperty,早些的文章中可能会使用UProperty,本文以5.1为演示平台,使用时注意版本对应。
WidgetBlueprint->Modify(); } } else { // 创建用户控件蓝图 UWidgetBlueprintFactory* WidgetFactory = NewObject<UWidgetBlueprintFactory>(); WidgetFactory->AddToRoot(); UPackage* WidgetPackage = CreatePackage(*WBPPackage); WidgetBlueprint = Cast<UWidgetBlueprint>(WidgetFactory->FactoryCreateNew(...
Slate Widget Style Style_ Widget Blueprint WBP_ 1.2.12 EffectsAsset TypePrefixSuffixNotes Particle System PS_ Material (Post Process) PP_ ⬆ Back to Top2. Content Directory StructureEqually important as asset names, the directory structure style of a project should be considered law. Asset ...
Blueprint BP_ Material M_ Static Mesh S_ Many use SM_. We use S_. Skeletal Mesh SK_ Texture T_ _? See Textures Particle System PS_ Widget Blueprint WBP_ 1.2.2 AnimationsAsset TypePrefixSuffixNotes Aim Offset AO_ Aim Offset 1D AO_ Animation Blueprint ABP_ Animation Composite...