feat: expand editor scripting asset and viewport flow
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Platform/D3D12WindowRenderer.h"
|
||||
#include "Scripting/EditorScriptRuntimeStatus.h"
|
||||
#include "UI/ImGuiBackendBridge.h"
|
||||
#include "UI/ImGuiSession.h"
|
||||
#include "Viewport/ViewportHostService.h"
|
||||
@@ -19,6 +20,12 @@ class RHIDevice;
|
||||
class RHISwapChain;
|
||||
} // namespace RHI
|
||||
|
||||
namespace Scripting {
|
||||
#ifdef XCENGINE_ENABLE_MONO_SCRIPTING
|
||||
class MonoScriptRuntime;
|
||||
#endif
|
||||
} // namespace Scripting
|
||||
|
||||
namespace Editor {
|
||||
|
||||
class EditorLayer;
|
||||
@@ -33,6 +40,8 @@ public:
|
||||
void Render();
|
||||
void OnResize(int width, int height);
|
||||
bool SwitchProject(const std::string& projectPath);
|
||||
bool ReloadScriptingRuntime();
|
||||
bool RebuildScriptingAssemblies();
|
||||
void SaveProjectState();
|
||||
Rendering::RenderContext GetMainRenderContext() const { return m_windowRenderer.GetRenderContext(); }
|
||||
RHI::RHIDevice* GetMainRHIDevice() const { return m_windowRenderer.GetRHIDevice(); }
|
||||
@@ -42,6 +51,7 @@ public:
|
||||
HWND GetWindowHandle() const { return m_hwnd; }
|
||||
|
||||
IEditorContext& GetEditorContext() const { return *m_editorContext; }
|
||||
const EditorScriptRuntimeStatus& GetScriptRuntimeStatus() const { return m_scriptRuntimeStatus; }
|
||||
|
||||
private:
|
||||
Application() = default;
|
||||
@@ -52,6 +62,8 @@ private:
|
||||
void AttachEditorLayer();
|
||||
void DetachEditorLayer();
|
||||
void ShutdownEditorContext();
|
||||
void InitializeScriptingRuntime(const std::string& projectPath);
|
||||
void ShutdownScriptingRuntime();
|
||||
void RenderEditorFrame();
|
||||
void UpdateWindowTitle();
|
||||
|
||||
@@ -70,6 +82,10 @@ private:
|
||||
bool m_hasLastFrameTime = false;
|
||||
bool m_renderReady = false;
|
||||
bool m_resourceManagerInitialized = false;
|
||||
EditorScriptRuntimeStatus m_scriptRuntimeStatus;
|
||||
#ifdef XCENGINE_ENABLE_MONO_SCRIPTING
|
||||
std::unique_ptr<::XCEngine::Scripting::MonoScriptRuntime> m_scriptRuntime;
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user