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 ์ํ๊ฐ์ ์คํ์ํฐ ๋ง์คํฌ๋ก ์ฐ๊ฒฐ