voidAMyTest::BeginPlay(){Super::BeginPlay();// 增加子Actorif(ActorC!=nullptr){FTransform Transform=UKismetMathLibrary::MakeTransform(FVector(0.0,0.0,0.0),FRotator(0.0,0.0,0.0),FVector(1.0,1.0,1.0));UActorComponent*AC=AddComponentByClass(UChildActorComponent::StaticClass(),false,TF,false);AC...
一. 概览UE的Gameplay是一个系统,里面包括很多的类,用于方便我们快速搭建一个项目。所有类之中,除了UObject,Actor和Component是相对基础的存在。Actor是一个容器,包含了不同功能的Components,如USceneCompon…
GatherActor阶段:在收集 Actor 时,收集所有相关的 Actor 列表,遍历 Actor 列表去一个个处理,处理之前是不知道哪些 Actor 在这一帧内同步属性被修改了,需要后续更多的逻辑去判断是否这个 Actor 在这一帧需要同步 属性对比阶段:针对一个 Actor 或 Component,引擎同样也是不能提前知道这个 Actor 有哪些属性改变,同样得...
美术大哥提的需求里主要需要获取浮点数(5.1中默认双精度,其实对应的是double)、布尔值(bool)、颜色值(FLinearColor)三种类型。考虑到后续升级和复用,我创建了一个C++的ActorComponent挂载到Dynamic Sky Actor上。使用这个Component作为作为数据控制器。接下来就是如何把数据从三种已经调好的流送关卡中读取出来、写到Data...
UActorComponent::RegisterComponentWithWorld() []0x00007ff70650901e meta1213-Win64-Shipping.exe!AActor::IncrementalRegisterComponents() []0x00007ff7069d9985 meta1213-Win64-Shipping.exe!ULevel::UpdateLevelComponents() []0x00007ff706e97c3a meta1213-Win64-Shipping.exe!UWorld::UpdateWorldComponents() ...
原理和增加组件是一样的,增加一个ChildActorComponent,再设置ChildActorClass,我们直接上代码 给MyTest.h中增加一个属性,用于我们方便的指定子对象的蓝图资源 public:/** * 子对象的蓝图资源 */UPROPERTY(EditAnywhere,BlueprintReadWrite,Category="MyTest")TSubclassOf<AActor>ActorC; ...
ComponentMask & SplitComponents ComponentMask允许从输入中挑选某个通道子集(R、G、B和/或A)并输出 SplitComponents与Mask类似,不过它更加灵活 Append & AppendMany Append合并两个类型,形成一个新类型 AppendMany可以合并多个通道 Swizzle 排列floatn分量
addMappingContext(self.defaultMappingContext, 0) inputComponent.bindAction(self.jumpAction, ETriggerEvent.Triggered, self, n"jump") inputComponent.bindAction(self.jumpAction, ETriggerEvent.Completed, self, n"stopJumping") inputComponent.bindAction(self.moveAction, ETriggerEvent.Triggered, self, n"move...
8 + PrimaryActorTick.bCanEverTick = true; 9 + 10 + SpringArmComp = CreateDefaultSubobject<USpringArmComponent>("SpringArmComp"); 11 + SpringArmComp->bUsePawnControlRotation = true; 12 + SpringArmComp->SetupAttachment(RootComponent); 13 + 14 + CameraComp = CreateDefaultSubobject<UCam...
导出ActorComponent中OnComponentCreated和RegisterComponent等函数: // Export Actor Component BEGIN_EXPORT_REFLECTED_CLASS(UActorComponent) ADD_FUNCTION(RegisterComponent) ADD_FUNCTION(OnComponentCreated) ADD_FUNCTION(UnregisterComponent) ADD_CONST_FUNCTION_EX("IsRegistered",bool, IsRegistered) ...