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
	};
}
相关推荐
zhangzhangkeji4 天前
UE5 C++(71):文件是否存在,文件夹是否存在,FPaths :: FileExists( const FString & InPath) ;
ue5
妙为4 天前
UE5角色穿过石头穿模
ue5·unreal engine5·角色穿越石头·穿模
技术策划Boring5 天前
2025年工作复盘:开放世界3A项目配置管线与性能监控的探索
游戏·ue5·虚幻·p4·perforce
zhangzhangkeji7 天前
UE5 C++(70-2):定义成员函数 getCleanDirectory(..) 和枚举类 EFileDirectoryType,来获得目录
ue5
avi91118 天前
UE4-UE5虚幻引擎-前置学习三,优化,基础CPP
ue5·ue4·游戏开发·虚幻·游戏优化·游戏代码
zhangzhangkeji8 天前
UE5线程进阶(3-2):任务图的相关源码整理。 FGraphEvent 与 TGraphTask 的区别和联系
ue5
zhangzhangkeji10 天前
UE5线程进阶(3-1):
ue5
zhangzhangkeji10 天前
UE5线程进阶(2-3):enum ENamedThreads命名空间 :: Type : int32 { RHIThread = 0 } 是渲染硬件接口线程
ue5
zhangzhangkeji11 天前
UE5线程进阶(2-1):枚举类EAsyncExecution,作业类TAsyncRunnable、TAsyncQueuedWork,及全局线程函数 Async(..),及线程调用的 4 种方法总结
ue5
zhangzhangkeji12 天前
UE5线程进阶(1):
ue5