我们首先尝试复现一下之前第4节的内容,在场景中建立一个Cube对象,不过这一次我们建立的Actor名称为CreateMeshActor,当然也可以是读者自己想到的任何一个名字。 在CreateMeshActor的构造函数中,我们还是声明一个UStaticMeshComponent类型的成员对象mesh,通过CreateDefaultSubobject()建立它的实例,并设置为Root Component(也就...
Actor Filter:过滤Actor的方法 Self:得到的是PCG Component所附加到的actor自身上的信息 Parent:得到的是PCG Component所附加到的actor的父级身上的信息 Root:得到的是PCG Component所附加到的actor的层次结构顶部的父级身上的信息 All actors in world:得到的是世界中所有Actor的信息,因为需要遍历世界中的所有actor,所...
RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent")); selectCircle = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("selectCircle"));staticConstructorHelpers::FObjectFinder<UStaticMesh>PlaneAsset(TEXT("/Script/Engine.StaticMesh'/Engine/BasicShapes/Plane.Plane'"));staticC...
FTransform FinalRootComponentTransform= (RootComponent ? RootComponent->GetComponentTransform() : UserTransform);//see if we need to adjust the transform (i.e. in deferred cases where the caller passes in a different transform here//than was passed in during the original SpawnActor call)if(Root...
RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent")); selectCircle = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("selectCircle")); static ConstructorHelpers::FObjectFinder<UStaticMesh> PlaneAsset(TEXT("/Script/Engine.StaticMesh'/Engine/BasicShapes/Plane.Plane'")); ...
2、然后再在构造函数中加载2.1创建的蓝图,代码如下:其中“"/Script/UMGEditor.WidgetBlueprint'/Game/BluePrint/UI3D.UI3D_C'"为2.1中创建的蓝图的引用,注意后面一定要加上后缀”_C“。 My3DUI = CreateDefaultSubobject(TEXT("My3DUI")); My3DUI->SetupAttachment(RootComponent); ...
[DisallowMultipleComponent](单独对象禁用重复脚本) 01:27 OnEnable(脚本激活后执行代码) 01:01 GetComponents<>()(从单个对象获取一堆组件) 03:41 GetComponent<>()(获取组件) 02:00 GetType,typeof,System.Type(把变量类型作为变量) 08:37 UnityEngine.Events.UnityEvent UnityEvent.Invoke()(自定义事件变量...
SpringArmComp->SetupAttachment(RootComponent); CameraComp = CreateDefaultSubobject<UCameraComponent>("CameraComp"); CameraComp->SetupAttachment(SpringArmComp); GetCharacterMovement()->bOrientRotationToMovement = true; bUseControllerRotationYaw = false; } void ASurCharacter::BeginPlay() { Super::BeginPl...
ChildActorComponent = CreateDefaultSubobject<UChildActorComponent>("Slot");// ChildActorComponent->SetChildActorClass(TSubclassOf<ASlot>());// ChildActorComponent->SetupAttachment(RootComponent);// const auto temp_childActorComponent = NewObject<UChildActorComponent>(this, UChildActorComponent::...
FireEffect->SetupAttachment(RootComponent); 2. 请简要阐述UFUNCTION()中 BlueprintCallable,BlueprintPure的区别是什么? BlueprintImplementableEvent有什么用? BlueprintNativeEvent有什么用? 参考连接 BlueprintCallable,BlueprintPure的区别是什么? 区别是BlueprintCallable有执行线,BlueprintPure没有。