ue5 小知识点 ue的world type,pie editor game

说明以该命令行模式启动游戏的前提下的两个问题:

1.WITH_EDITOR中的代码会被编译

2.由于没有在编辑器中(即没有打开虚幻编辑器),所以GIsEditor为false

WITH_EDITOR和WITH_EDITORONLY_DATA的区别

在论坛中找到的答案:

复制代码
WITH_EDITORONLY_DATA in headers for wrapping reflected members.
WITH_EDITOR in CPP files for code.. Has nothing to do with reflection.

意思就是:

头文件中使用WITH_EDITORONLY_DATA包装反射的成员。

在CPP文件的代码中使用WITH_EDITOR,与反射无关。

callineditor

cpp 复制代码
	
.h
    UFUNCTION(CallInEditor, Category = "Sky Creator|General")
	void SetEditorTimeOfDay(float NewValue);
	UFUNCTION(CallInEditor, Category = "Sky Creator|General")
	void SetEditorWeatherPreset(USkyCreatorWeatherPreset* NewValue);
	UFUNCTION(CallInEditor, Category = "Sky Creator|General")
	void SetEditorWeatherSettings(FSkyCreatorWeatherSettings NewValue);

.cpp


#define SKYCREATOR_DECLARE_SEQUENCER_SETFUNCTION_ANDUPDATE(MemberType, MemberName) void ASkyCreator::Set##MemberName(MemberType NewValue)\
{\
	if (MemberName != NewValue)\
	{\
		MemberName = NewValue;\
		UpdateSettings();\
	}\
}\

SKYCREATOR_DECLARE_SEQUENCER_SETFUNCTION(float, EditorTimeOfDay);
SKYCREATOR_DECLARE_SEQUENCER_SETFUNCTION_ANDUPDATE(USkyCreatorWeatherPreset*, EditorWeatherPreset);

SKYCREATOR_DECLARE_SEQUENCER_SETFUNCTION(float, SunriseTime);
SKYCREATOR_DECLARE_SEQUENCER_SETFUNCTION(float, SunsetTime);
SKYCREATOR_DECLARE_SEQUENCER_SETFUNCTION(float, SunDawnOffsetTim
cpp 复制代码
//ue 5.2
namespace EWorldType
{
	enum Type
	{
		/** An untyped world, in most cases this will be the vestigial worlds of streamed in sub-levels */
		None,

		/** The game world */
		Game,

		/** A world being edited in the editor */
		Editor,

		/** A Play In Editor world */
		PIE,

		/** A preview world for an editor tool */
		EditorPreview,

		/** A preview world for a game */
		GamePreview,

		/** A minimal RPC world for a game */
		GameRPC,

		/** An editor world that was loaded but not currently being edited in the level editor */
		Inactive
	};
}
相关推荐
__Ryan3 小时前
BlueprintImplementableEvent和BlueprintNativeEvent
c++·ue5·unreal engine
zhangzhangkeji6 小时前
UE5 蓝图-游老师-12-结构体与枚举:都属于蓝图里的,枚举相关的函数 Switch on myBPEnum,
ue5
zhangzhangkeji6 小时前
UE5 蓝图-游老师-14-Actor事件接口-上:共 21个左右的 Actor事件。玩家控制器的函数:显示鼠标光标,启用鼠标悬停事件,启用点击事件。
ue5
Zhichao_978 小时前
【VRoid Studio】创建3D角色导入UE5
ue5
联系QQ19226389 小时前
完整的PID和LQR四旋翼无人机simulink,matlab仿真,两个slx文件一个m文件...
ue5
吴梓穆1 天前
UE5 插件没有自动打包所需的dll
ue5
zhangzhangkeji1 天前
UE5 蓝图-游老师-10-蓝图中的选择分支与循环:br , for loop, while loop
ue5
曼巴UE51 天前
UE5 C++ 动态单播放
c++·ue5
Vince丶3 天前
UE DirectExcel使用笔记
笔记·ue5
AA陈超3 天前
Lyra学习004:GameFeatureData分析
c++·笔记·学习·ue5·虚幻引擎