Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
We create a new actor (based on StaticMeshActor for convenience, as it saves us having to declare or create a Static Mesh component for the Actor visual representation).
We declare a dynamic multicast delegate using the DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam macro. Dynamic multicast delegates allow an arbitrary number of objects to subscribe (listen) and unsubscribe (stop listening) so that they will be notified when the delegate is broadcast.
The macro takes a number of arguments – the type name of the new delegate signature being created, the type of the signature's parameter, then the name of the signature's parameter.
We also add a function to King that will allow us to tell it to die. Because we want to expose the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access