UE4基础
基础的UE4C++知识
lcy_oxalsicl
这个作者很懒,什么都没留下…
展开
-
UE4蓝图 绑定输入
在蓝图中绑定输入:在项目设定中设定绑定类型在蓝图中即可显示相关绑定3.最终效果附c++开启输入:一般情况下,Actor及其子类需要开启输入需要用到EnableInput()方法Actor.h/** * Pushes this actor on to the stack of input being handled by a PlayerController. * @param PlayerController The PlayerController whose input原创 2022-01-18 09:17:50 · 948 阅读 · 0 评论 -
UE4C++ 指定游戏或UI接受输入事件
在游戏过程中存在只需要UI接受输入事件的需求调用APlayerController::SetInputMode(const FInputModeDataBase& InData)来处理PlayerController.cpp/** Setup an input mode. */void APlayerController::SetInputMode(const FInputModeDataBase& InData){ UGameViewportClient* GameViewpo原创 2022-01-16 22:30:23 · 3523 阅读 · 0 评论 -
UE4C++ UI接受键盘/鼠标事件
UUserWidget.h把bIsFocusable 设置为true重写OnKeyDown() /** Setting this flag to true, allows this widget to accept focus when clicked, or when navigated to. */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Interaction") uint8 bIsFocusable : 1; /原创 2022-01-16 22:07:30 · 1745 阅读 · 1 评论 -
UE4C++ 创建UI
UE4UI的创建原创 2022-01-16 21:57:54 · 1211 阅读 · 0 评论 -
UE4C++ 添加组件
构造函数与Runtime状态下组件的创建组件的绑定与在细节面板中的显示原创 2022-01-15 10:57:25 · 2569 阅读 · 0 评论 -
UE4C++ Actor开启Input输入
UE4C++ Actor开启Input输入//引入UGameplayStatics的头文件,后续查找PlayerController#include "Kismet/GameplayStatics.h"// Called when the game starts or when spawnedvoid AClickTestActor::BeginPlay(){ Super::BeginPlay(); //获取PlayerController APlayerController* Playe原创 2021-12-14 10:08:42 · 1990 阅读 · 1 评论 -
UE4C++ 组件调用射线检测
.h UFUNCTION() void StartLineTrace(); UPROPERTY() AActor* RootActor;};.cpp// Called when the game startsvoid ULineTraceComponent::BeginPlay(){ Super::BeginPlay(); // 绑定射线检测事件 if (RootActor==nullptr) { RootActor = GetAttachmentRootActor();原创 2021-12-15 11:42:12 · 1058 阅读 · 0 评论