Integrating up through commit 90f050496
This commit is contained in:
@@ -40,14 +40,10 @@ namespace Camera
|
||||
void CameraComponent::Activate()
|
||||
{
|
||||
CameraComponentBase::Activate();
|
||||
|
||||
m_controller.ActivateAtomView();
|
||||
}
|
||||
|
||||
void CameraComponent::Deactivate()
|
||||
{
|
||||
m_controller.DeactivateAtomView();
|
||||
|
||||
CameraComponentBase::Deactivate();
|
||||
}
|
||||
|
||||
@@ -62,6 +58,28 @@ namespace Camera
|
||||
return true;
|
||||
}
|
||||
|
||||
class CameraNotificationBus_BehaviorHandler : public CameraNotificationBus::Handler, public AZ::BehaviorEBusHandler
|
||||
{
|
||||
public:
|
||||
AZ_EBUS_BEHAVIOR_BINDER(CameraNotificationBus_BehaviorHandler, "{91E442A0-37E7-4E03-AB59-FEC11A06741D}", AZ::SystemAllocator,
|
||||
OnCameraAdded, OnCameraRemoved, OnActiveViewChanged);
|
||||
|
||||
void OnCameraAdded(const AZ::EntityId& cameraId) override
|
||||
{
|
||||
Call(FN_OnCameraAdded, cameraId);
|
||||
}
|
||||
|
||||
void OnCameraRemoved(const AZ::EntityId& cameraId) override
|
||||
{
|
||||
Call(FN_OnCameraRemoved, cameraId);
|
||||
}
|
||||
|
||||
void OnActiveViewChanged(const AZ::EntityId& cameraId) override
|
||||
{
|
||||
Call(FN_OnCameraRemoved, cameraId);
|
||||
};
|
||||
};
|
||||
|
||||
void CameraComponent::Reflect(AZ::ReflectContext* reflection)
|
||||
{
|
||||
CameraComponentBase::Reflect(reflection);
|
||||
@@ -101,6 +119,11 @@ namespace Camera
|
||||
->Attribute(AZ::Script::Attributes::Category, "Camera")
|
||||
->Event("GetActiveCamera", &CameraSystemRequestBus::Events::GetActiveCamera)
|
||||
;
|
||||
|
||||
behaviorContext->EBus<CameraNotificationBus>("CameraNotificationBus")
|
||||
->Attribute(AZ::Script::Attributes::Category, "Camera")
|
||||
->Handler<CameraNotificationBus_BehaviorHandler>()
|
||||
;
|
||||
}
|
||||
}
|
||||
} //namespace Camera
|
||||
|
||||
Reference in New Issue
Block a user