当前位置:网站首页>U++ game learning notes

U++ game learning notes

2022-07-07 05:03:00 It's a bald rabbit

At the top of each game class header , You need to include the generated header file ( Automatically create )

ClassName Not really a string ClassName, It's the class name , as follows  

#include "ClassName.generated.h"

Class declarations also define class specifiers And metadata   Other engine and editor specific behaviors that may be required . Besides ,GENERATED_BODY()  Macros must be placed at the beginning of the class body .

UCLASS([specifier, specifier, ...], [meta(key=value, key=value, ...)])
class ClassName : public ParentName
{
    GENERATED_BODY()
}

When declaring a class , Can be class A specifier is added to the declaration , To control how classes behave in all aspects of the engine and editor .

In the declaration class 、 Interface 、 structure 、 enumeration 、 Enumerated values 、 Function or property , You can add Metadata Specifiers to control how they interact with all aspects of the engine and editor . Each type of data structure or member has its own metadata specifier list .


  Some constructors may be located in a special part of each module “ Constructors ” In file . for example ,AActor::AActor Constructors can be used in EngineConstructors.cppDEFAULTS This is the result of the automatic conversion process from the previous use of blocks to the use of constructors . as time goes on , These will be moved to their respective class source files .


Function specifiers :

CallInEditor Usage method :

 


Metadata specifier :

 

 

原网站

版权声明
本文为[It's a bald rabbit]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207062236359119.html