Fixed light registration issues

This commit is contained in:
Axel 2022-11-23 17:14:23 +01:00 committed by bernat
parent f4334551a0
commit 6625d66e78
3 changed files with 4 additions and 5 deletions

View File

@ -230,10 +230,6 @@ void ACarlaGameModeBase::BeginPlay()
for(UCarlaLight* Light : Lights) for(UCarlaLight* Light : Lights)
{ {
Light->RegisterLight(); Light->RegisterLight();
if(!Light->HasBegunPlay())
{
Light->BeginPlay();
}
} }
} }
EnableOverlapEvents(); EnableOverlapEvents();

View File

@ -33,7 +33,7 @@ void UCarlaLight::RegisterLight()
UCarlaLightSubsystem* CarlaLightSubsystem = World->GetSubsystem<UCarlaLightSubsystem>(); UCarlaLightSubsystem* CarlaLightSubsystem = World->GetSubsystem<UCarlaLightSubsystem>();
CarlaLightSubsystem->RegisterLight(this); CarlaLightSubsystem->RegisterLight(this);
} }
RegisterLightWithWeather();
bRegistered = true; bRegistered = true;
} }

View File

@ -51,6 +51,9 @@ public:
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Carla Light") UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Carla Light")
void UpdateLights(); void UpdateLights();
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Carla Light")
void RegisterLightWithWeather();
UFUNCTION(BlueprintCallable, Category = "Carla Light") UFUNCTION(BlueprintCallable, Category = "Carla Light")
void SetLightIntensity(float Intensity); void SetLightIntensity(float Intensity);