on demand reflect az events when they are the return value of ebuses (#6625)

Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com>
monroegm-disable-blank-issue-2
carlitosan 4 years ago committed by GitHub
parent 50b22a23cf
commit c83bf11a3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1159,7 +1159,7 @@ namespace ScriptCanvasEditor
, AZStd::string_view eventName
, const ScriptCanvas::EBusBusId& busId
, const ScriptCanvas::EBusEventId& eventId
, const AZ::BehaviorEBusEventSender&
, const AZ::BehaviorEBusEventSender& sender
, ScriptCanvas::PropertyStatus propertyStatus
, bool isOverload)
{
@ -1193,6 +1193,17 @@ namespace ScriptCanvasEditor
senderInformation->m_displayName = details.m_name.empty() ? eventName : details.m_name.c_str();
senderInformation->m_toolTip = details.m_tooltip.empty() ? "" : details.m_tooltip;
auto safeRegister = [](AZ::BehaviorMethod* method)
{
if (method && AZ::MethodReturnsAzEventByReferenceOrPointer(*method))
{
const AZ::BehaviorParameter* resultParameter = method->GetResult();
ScriptCanvas::ReflectEventTypeOnDemand(resultParameter->m_typeId, resultParameter->m_name, resultParameter->m_azRtti);
}
};
safeRegister(sender.m_event);
safeRegister(sender.m_broadcast);
m_registeredNodes.emplace(AZStd::make_pair(nodeIdentifier, senderInformation));
}
}

Loading…
Cancel
Save