Unrealengine4 uobject (1)

Source: Internet
Author: User

The most critical implementation of Runtime is uobject, which is the base class of all engine-level and game-level objects.

Uobject implements dynamic creation, persistence, scripting, memory management, and lifecycle control.

---------------------------

About dynamic creation

---------------------------

Creating an object using a class name is a dynamic creation.

The unrealengine4 process is:

Fstringclassreference xxxxclassname;

|

Tsubclassof <XXXX> xxxxclass;

|

XXXX * xxxxobject ;;

Find the runtime type information through the class name, and then create an object through the runtime type information.

Ufield, ustruct, uclass, uproperty, ufunction, and uenum are the data structures used to construct runtime information. For details, see runtime/coreuobject/public/uobject/class. h.

At this time, a problem arises: how to build these runtime type information?

In unrealengine4, each class corresponds to a XXXX. generated. H, which contains the macro definition code for constructing runtime type information. This XXXX. gengerated. H is generated through unrealheadertool (UHT.

UHT is generated by parsing the keyword uclass, ustruct, uproperty, ufunction, and uenum in each header file.


Unrealengine4 uobject (1)

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.