Unreal Engine 4 - Gakgu/Gakgu.github.io GitHub Wiki
MyProject.Build.cs 에 다음과 같이 추가
PublicAdditionalLibraries.Add(@"C:/Program Files/Microsoft SDKs/Kinect\v2.0_1409/Lib\x64/kinect20.lib");
MyProjectName.Build.cs 에서 PublicDependencyModuleNames.AddRange(...) 에 모듈을 추가한다.
파일 - Visual Studio 프로젝트 새로고침
형식은 primitivecomponent.h 참고
UFUNCTION()
void BeginOverlap(UPrimitiveComponent* OverlappedComponent, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult);
MyClass::MyClass()
{
OnComponentBeginOverlap.AddDynamic(this, &MyClass::BeginOverlap);
}
void MyClass::BeginOverlap(UPrimitiveComponent* OverlappedComponent, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
{
// ...
}
안전한 객체의 파괴를 위해서는 Destroy()가 실행된 객체가 Tick()을 실행하는 일이 없어야 한다.
bDestroy = fasle;
DestroyFromTick(){ bDestroy = true; }
void MyClass::Tick(){
if(bDestroy == true){
Destroy();
return;
}
// ...
}
MyClass* myclass;
MyClass* can_access_myclass = Cast<MyClass>(myclass);
template<typename FindObjectType>
FORCEINLINE FindObjectType* YOURCLASS::FindObjectName(FString name)
{
for (TActorIterator<FindObjectType> ActorItr(GetWorld()); ActorItr; ++ActorItr)
{
if (ActorItr->GetName() == name)
{
return *ActorItr;
}
}
return nullptr;
}
template <typename ClassType>
ClassType* YOURCLASS::GetComponentByActor(AActor* actor)
{
TArray<ClassType*> Comps;
actor->GetComponents(Comps);
if (Comps.Num() > 0)
return Comps[0];
return nullptr;
}
블랜드모드 - Masked 알파값을 오파시티 마스크로 연결