The use of UE4 Unreal Engine on the event dispatcher!

The use of UE4 Unreal Engine on the event dispatcher!

First of all, this time, let’s talk about how the event dispatcher, UI, Pawn, and sub-actors perform event delivery!

first! What is the reason if we want to use event dispatcher!

First, it must be convenient and fast!

Second, for fast query speed and efficiency optimization!

Otherwise everything is fine, get actor of class! Because of this speed, it is too slow in the program, and it is generally not used! Except when absolutely necessary!

first! We need to know who is the middleman!

who is it!

Pawn of course!

We can get pawn through get player Pawn!

This method of acquisition is the fastest, and the speed is also leveraged!

Because pawn is the middleman! So the event dispatcher is to be created!

Then create it directly!

We don't move it either!

At that time, we need to know that the event dispatcher has two functions, one is call call, and the other is bind binding

 So, let's clarify the management, what the UI is usually used for! What are sub-actors for!

The UI is usually an interface, and events can be sent by clicking and other interactions, which means that we need to call this event dispatcher and tell him to work!

bind is binding, we want to bind an event, when the event dispatcher is called, this event starts to execute!

After clarifying it!

We get a result!

Call in the UI, in the actor! Among the bindings, Pawn is a middleman! Just create it! Look at both sides! !

UI:

Child actors:

 

 This way the sub-event dispatcher is fine!

Guess you like

Origin blog.csdn.net/m0_46449592/article/details/128227080