在4.6版本中release note有以下说明:
You now define and use “normal” C++ constructors for your classes. You can use parameterless -constructors too now!
You no longer need to supply a category for your properties to expose them to the editor or Blueprints. You’ll get a default category now.
FPostContructInitializeProperties is deprecated. It’s replaced by FObjectInitializer, and you only have to specify it when you actually need it
“GENERATED_BODY” no longer resets your protection level to “public”. It will preserve your settings.
Please use the new “GENERATED_BODY” specifier instead of “GENERATED_UCLASS_BODY”. It enables many of these new improvements!
翻译过来
- 可以定义和使用“常规”的C++构造函数,可以使用无参构造函数。
- 不再需要为属性提供类别以将其显示给编辑器或蓝图。现在有默认类别
FPostContructInitializeProperties
已经弃用,由FObjectInitializer
代替,只需要在实际需要时指定它即可- “
GENER