Removed the asset callback from the EditorReflectionProbeComponent, since the component may have been destroyed and recreated between the bake and the asset load.

Replaced with an OnTick handler that polls the ReflectionProbeFeatureProcessor to determine when the asset is ready.
This commit is contained in:
dmcdiar
2021-05-04 01:24:14 -07:00
parent 781415755d
commit 64f42ba1cb
9 changed files with 210 additions and 156 deletions
@@ -13,6 +13,7 @@
#pragma once
#include <AzCore/std/parallel/atomic.h>
#include <AzCore/Component/TickBus.h>
#include <AzFramework/Entity/EntityDebugDisplayBus.h>
#include <AzToolsFramework/API/ComponentEntitySelectionBus.h>
#include <ReflectionProbe/ReflectionProbeComponent.h>
@@ -29,6 +30,7 @@ namespace AZ
, public EditorReflectionProbeBus::Handler
, private AzToolsFramework::EditorComponentSelectionRequestsBus::Handler
, private AzFramework::EntityDebugDisplayEventBus::Handler
, private AZ::TickBus::Handler
{
public:
using BaseClass = EditorRenderComponentAdapter<ReflectionProbeComponentController, ReflectionProbeComponent, ReflectionProbeComponentConfig>;
@@ -45,8 +47,12 @@ namespace AZ
// AzFramework::EntityDebugDisplayEventBus::Handler overrides
void DisplayEntityViewport(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) override;
private:
// AZ::TickBus overrides
void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
// validation
AZ::Outcome<void, AZStd::string> OnUseBakedCubemapValidate(void* newValue, const AZ::Uuid& valueType);