📅  最后修改于: 2022-03-11 14:55:32.055000             🧑  作者: Mango
void ALightSwitchCodeOnly::OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
// Other Actor is the actor that triggered the event. Check that is not ourself.
if ( (OtherActor != nullptr ) && (OtherActor != this) && ( OtherComp != nullptr ) )
{
// Turn off the light
PointLight->SetVisibility(false);
}
}