一、Set Timer by Function Name 二、Set Timer by Event 3、根据名字获得成员变量(C++支持) 4、根据名字获得组件(蓝图支持) 函数“Get Components by Class”有一个Bug,这个蓝图一经拖放出来的“Component Class”就是“ActorComponent”,这时直接编译是会出错的,要重新选择一下其他的“Component Class”然后再选择...
OwnerActor)return;UAttackComp*AttackComponent=Cast<UAttackComp>(OwnerActor->GetComponentByClass(UAttac...
>GetComponentByClass(UStaticMeshComponent::StaticClass())); map.Find(parentObj)->Add(itemstatic); } } else { if (attachActors.Num() == 0) { TArray<UPrimitiveComponent*> staticActors; auto itemstatic = Cast<UStaticMeshComponent>(actor->GetComponentByClass(UStaticMeshComponent::StaticClass(...
TSoftObjectPtr TSoftClassPtr //蓝图调用函数 UFUNCTION(BlueprintCallable, Category = "XXX") //设置子Actor HandObject->SetChildActorClass(ASlAiHandObject::StaticClass()); //继承父类 Super::Xxx(); //获取组件 GetComponentByClass(UXXXComponent::StaticClass()); //调整Tick间隔为1秒 PrimaryActor...
UBoxComponent* BoxComponent = Cast<UBoxComponent>(AICoverPointsGenerator->GetComponentByClass(UBoxComponent::StaticClass())); //获取类相关属性 UProperty* bDrawDebug = AAICoverPointsGeneratorClass->FindPropertyByName(FName(TEXT("bDrawDebug"))); ...
UBoxComponent* BoxComponent = Cast<UBoxComponent>(AICoverPointsGenerator->GetComponentByClass(UBoxComponent::StaticClass())); //获取类相关属性 UProperty* bDrawDebug = AAICoverPointsGeneratorClass->FindPropertyByName(FName(TEXT("bDrawDebug"))); ...
UPrimitiveComponent* Primitive = MyActor->GetComponentByClass(UPrimitiveComponent::StaticClass); USphereComponent* SphereCollider = Cast<USphereComponent>(Primitive); if (SphereCollider != nullptr) { // ... } 销毁GameObject / Actor Unity C#: ...
Super::Tick(DeltaTime);floatCurrentScale = OurVisibleComponent->GetComponentScale().X;if(bGrowing) { CurrentScale+=DeltaTime; }else{ CurrentScale-= (DeltaTime *0.5f); } CurrentScale= FMath::Clamp(CurrentScale,1.0f,2.0f); OurVisibleComponent->SetWorldScale3D(FVector(CurrentScale));if(!Curren...
FPrimitiveSceneProxy* UStevesEditorVisComponent::CreateSceneProxy() { auto Ret = new FStevesDebugRenderSceneProxy(this); const FTransform& XForm = GetComponentTransform(); for (auto& L : Lines) { Ret->Lines.Add(FDebugRenderSceneProxy::FDebugLine(XForm.TransformPosition(L.Start), XForm....
();rb=GetComponent<Rigidbody>();}voidStart(){state=State.wait;}privatevoidOnMouseDown(){if(state==State.back&&rb.velocity.y<0){gc.AddScore(5);}TurnState();}privatevoidOnCollisionEnter(Collision collision){if(state==State.wait)return;if(state==State.back){gc.GameOver();}else{TurnState...