MCPcopy Create free account
hub / github.com/esengine/esengine / getRuntimeModeConfig

Function getRuntimeModeConfig

packages/runtime-core/src/RuntimeMode.ts:133–174  ·  view source on GitHub ↗
(mode: RuntimeMode)

Source from the content-addressed store, hash-verified

131 * @returns @zh 模式配置 @en Mode configuration
132 */
133export function getRuntimeModeConfig(mode: RuntimeMode): RuntimeModeConfig {
134 switch (mode) {
135 case RuntimeMode.EditorStatic:
136 return {
137 enablePhysics: false,
138 enableBehaviorTree: false,
139 enableAnimation: false,
140 enableInput: false,
141 showGrid: true,
142 showGizmos: true,
143 showAxisIndicator: true,
144 triggerLifecycle: false,
145 isEditorEnvironment: true
146 };
147
148 case RuntimeMode.EditorPreview:
149 return {
150 enablePhysics: true,
151 enableBehaviorTree: true,
152 enableAnimation: true,
153 enableInput: true,
154 showGrid: false,
155 showGizmos: false, // 预览时默认隐藏,可通过设置开启
156 showAxisIndicator: false,
157 triggerLifecycle: true,
158 isEditorEnvironment: true
159 };
160
161 case RuntimeMode.Standalone:
162 return {
163 enablePhysics: true,
164 enableBehaviorTree: true,
165 enableAnimation: true,
166 enableInput: true,
167 showGrid: false,
168 showGizmos: false,
169 showAxisIndicator: false,
170 triggerLifecycle: true,
171 isEditorEnvironment: false
172 };
173 }
174}
175
176/**
177 * @zh 检查模式是否为编辑器模式

Callers 2

setModeMethod · 0.90
initializeMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected