UE4 Study notes: Functions

Source: Internet
Author: User
function DeclarationThere are two kinds of functions in UE4, one is the traditional C + + function, the other is ufunction. Ufunction supports some special functions by adding some descriptors
Ufunction ([specifier, specifier, ...], [Meta (Key=value, Key=value, ...)])
ReturnType functionname ([Parameter, Parameter, ...])
There are several applications: Call in Blueprint as delegate, such as binding the network callback with the keystroke message and data synchronization as command line execution, with UE3 exec keyword
function DescriptorBlueprint related blueprintauthorithonly: Do not execute blueprintcallable in Blueprint without grid authorization: You can perform blueprint in blueprintcosmetic: The performance function does not perform blueprintimplementableevent on the server: You can override blueprintnativeevent in blueprint: Designed to be blueprint overridden, but still contains native implementations Blueprintpure: does not affect its own object network-related client: Server only: Execute netmulticast on the server only: execution of Reliable on servers and all clients: function execution is replicated over the network and is Reliable unreliable: functions may fail when copying execution editor related Category other customthunk: Provide custom Execfoo instead of generated Exec: can be executed at the command line meta data specifierBlueprintinternaluseonly blueprintprotected: Deprecatedfunction deprecationmessage is only called in blueprint Unsafeduringactorconstruction function argument specifierOut: Reference Optional: Optional, default value
delegate (Delegate)
Declare_delegate_oneparam (Fstringdelegate, fstring);

New Flogwriter ());

WRITETOLOGDELEGATE.BINDSP (LogWriter, &flogwriter::writetolog);
Writetologdelegate.execute (TEXT ("Delegates is spiffy!"));

It is recommended to use references when passing delegate, to avoid the multi-cast of memory allocations caused by the value of the event only the class itself that declares the event can invoke the broadcast of the event, Isbound, the clear function dynamic Delegate is bound with a function name, so it can be serialized but relatively slow
Timers (timer)
Getworldtimermanager (). SetTimer (thistrue);
Getworldtimermanager (). Cleartimer (this, &amatineeactor::checkpriorityrefresh);
Getworldtimermanager (). Istimeractive (This, &aplayercontroller::D elayedpreparemapchange)
The timer is not thread-safe and can only be used on game threads





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.