diff --git a/Editor/Editor/EditorLayer.cpp b/Editor/Editor/EditorLayer.cpp index ed9f972..e53f37e 100644 --- a/Editor/Editor/EditorLayer.cpp +++ b/Editor/Editor/EditorLayer.cpp @@ -268,7 +268,6 @@ namespace Prism if (ImGui::BeginMenu("Edit")) { ImGui::MenuItem("Physics Settings", nullptr, &m_ShowPhysicsSettings); - ImGui::EndMenu(); } @@ -284,6 +283,9 @@ namespace Prism Physics3D::DisconnectPVD(); } + ImGui::Separator(); + ImGui::MenuItem("GamePad View", nullptr, &m_ShowGamePadSettings); + ImGui::EndMenu(); } @@ -572,6 +574,9 @@ namespace Prism // m_EditorCamera.OnImGuiRender(); m_ConsolePanel->OnImGuiRender(); + // GamePad + DrawGamepadDebugPanel(m_ShowGamePadSettings); + // Editor Panel ------------------------------------------------------------------------------ ImGui::Begin("Environment"); { @@ -1175,6 +1180,249 @@ namespace Prism Application::Get().GetWindow().SetTitle(title); } + void EditorLayer::DrawGamepadDebugPanel(bool& p_open) + { + if (!p_open) + return; + + ImGui::Begin("Gamepad Debug", &p_open); + ImDrawList* drawList = ImGui::GetWindowDrawList(); + + bool anyConnected = false; + for (int jid = 0; jid <= 15; ++jid) + { + if (!Input::IsGamepadConnected(jid)) + continue; + + anyConnected = true; + const char* name = Input::GetGamepadName(jid); + bool isGamepad = Input::IsGamepad(jid); + + // 使用 CollapsingHeader 或 TreeNodeEx 均可,这里用 TreeNodeEx 保持与之前类似 + if (ImGui::TreeNodeEx((void*)(intptr_t)jid, ImGuiTreeNodeFlags_DefaultOpen, + "Joystick %d: %s%s", jid, name, isGamepad ? " (mapped)" : "")) + { + // ---------- 1. 摇杆与主要按钮行 ---------- + const float stickRadius = 40.0f; // 圆形摇杆半径 + const ImVec2 stickSize(stickRadius * 2, stickRadius * 2); + const float buttonSize = 30.0f; // 普通按钮(ABXY)的大小 + const float dpadButtonSize = 30.0f; // 十字键按钮稍小 + + // 左摇杆区域 + auto drawStick = [&](const char* label, float x, float y) + { + // 注意:GLFW 左 Y 向上为负,右 Y 向上为负,统一取反 + y = -y; + ImGui::BeginGroup(); + ImGui::Text("%s", label); + const ImVec2 pos = ImGui::GetCursorScreenPos(); + const ImVec2 center(pos.x + stickRadius, pos.y + stickRadius); + + // 圆形底板 + drawList->AddCircleFilled(center, stickRadius, IM_COL32(30,30,30,255)); + drawList->AddCircle(center, stickRadius, IM_COL32(100,100,100,255), 0, 2.0f); + // 十字参考线 + drawList->AddLine(ImVec2(center.x - stickRadius, center.y), ImVec2(center.x + stickRadius, center.y), IM_COL32(70,70,70,255)); + drawList->AddLine(ImVec2(center.x, center.y - stickRadius), ImVec2(center.x, center.y + stickRadius), IM_COL32(70,70,70,255)); + + // 摇杆位置点 + const float len = sqrtf(x*x + y*y); + float clampX = x, clampY = y; + if (len > 1.0f) { clampX /= len; clampY /= len; } + const float dotX = center.x + clampX * stickRadius; + const float dotY = center.y - clampY * stickRadius; // 屏幕Y向下,故用减 + drawList->AddCircleFilled(ImVec2(dotX, dotY), 6.0f, IM_COL32(255,80,80,255)); + if (len > 0.99f) + drawList->AddCircle(center, stickRadius, IM_COL32(255,255,0,150), 0, 3.0f); + + ImGui::Dummy(stickSize); + ImGui::EndGroup(); + }; + + // 十字键(上下左右) + auto drawDPad = [&]() + { + ImGui::BeginGroup(); + ImGui::Text("DPad"); + ImVec2 base = ImGui::GetCursorScreenPos(); + // 上 + bool up = Prism::Input::IsGamepadButtonPressed(jid, Prism::GamepadButton::DPAD_UP); + ImGui::SetCursorScreenPos(ImVec2(base.x + dpadButtonSize, base.y)); + ImGui::PushStyleColor(ImGuiCol_Button, up ? ImVec4(0.0f,1.0f,0.0f,1.0f) : ImVec4(0.3f,0.3f,0.3f,1.0f)); + ImGui::Button("U", ImVec2(dpadButtonSize, dpadButtonSize)); + ImGui::PopStyleColor(); + // 左 + bool left = Prism::Input::IsGamepadButtonPressed(jid, Prism::GamepadButton::DPAD_LEFT); + ImGui::SetCursorScreenPos(ImVec2(base.x, base.y + dpadButtonSize)); + ImGui::PushStyleColor(ImGuiCol_Button, left ? ImVec4(0.0f,1.0f,0.0f,1.0f) : ImVec4(0.3f,0.3f,0.3f,1.0f)); + ImGui::Button("L", ImVec2(dpadButtonSize, dpadButtonSize)); + ImGui::PopStyleColor(); + // 右 + bool right = Prism::Input::IsGamepadButtonPressed(jid, Prism::GamepadButton::DPAD_RIGHT); + ImGui::SetCursorScreenPos(ImVec2(base.x + 2*dpadButtonSize, base.y + dpadButtonSize)); + ImGui::PushStyleColor(ImGuiCol_Button, right ? ImVec4(0.0f,1.0f,0.0f,1.0f) : ImVec4(0.3f,0.3f,0.3f,1.0f)); + ImGui::Button("R", ImVec2(dpadButtonSize, dpadButtonSize)); + ImGui::PopStyleColor(); + // 下 + bool down = Prism::Input::IsGamepadButtonPressed(jid, Prism::GamepadButton::DPAD_DOWN); + ImGui::SetCursorScreenPos(ImVec2(base.x + dpadButtonSize, base.y + 2*dpadButtonSize)); + ImGui::PushStyleColor(ImGuiCol_Button, down ? ImVec4(0.0f,1.0f,0.0f,1.0f) : ImVec4(0.3f,0.3f,0.3f,1.0f)); + ImGui::Button("D", ImVec2(dpadButtonSize, dpadButtonSize)); + ImGui::PopStyleColor(); + + // 让 Group 大小包含整个十字区域 + ImGui::SetCursorScreenPos(ImVec2(base.x, base.y + 3*dpadButtonSize)); + ImGui::Dummy(ImVec2(3*dpadButtonSize, 0)); + ImGui::EndGroup(); + }; + + // ABXY 按钮组(按手柄实际位置排列:X左 Y上 B右 A下) + auto drawABXY = [&]() + { + ImGui::BeginGroup(); + ImGui::Text("Buttons"); + ImVec2 base = ImGui::GetCursorScreenPos(); + // Y 上 + bool y = Prism::Input::IsGamepadButtonPressed(jid, Prism::GamepadButton::Y); + ImGui::SetCursorScreenPos(ImVec2(base.x + buttonSize, base.y)); + ImGui::PushStyleColor(ImGuiCol_Button, y ? ImVec4(1.0f,0.8f,0.0f,1.0f) : ImVec4(0.3f,0.3f,0.3f,1.0f)); + ImGui::Button("Y", ImVec2(buttonSize, buttonSize)); + ImGui::PopStyleColor(); + // X 左 + bool x = Prism::Input::IsGamepadButtonPressed(jid, Prism::GamepadButton::X); + ImGui::SetCursorScreenPos(ImVec2(base.x, base.y + buttonSize)); + ImGui::PushStyleColor(ImGuiCol_Button, x ? ImVec4(0.0f,0.7f,1.0f,1.0f) : ImVec4(0.3f,0.3f,0.3f,1.0f)); + ImGui::Button("X", ImVec2(buttonSize, buttonSize)); + ImGui::PopStyleColor(); + // B 右 + bool b = Prism::Input::IsGamepadButtonPressed(jid, Prism::GamepadButton::B); + ImGui::SetCursorScreenPos(ImVec2(base.x + 2*buttonSize, base.y + buttonSize)); + ImGui::PushStyleColor(ImGuiCol_Button, b ? ImVec4(1.0f,0.0f,0.0f,1.0f) : ImVec4(0.3f,0.3f,0.3f,1.0f)); + ImGui::Button("B", ImVec2(buttonSize, buttonSize)); + ImGui::PopStyleColor(); + // A 下 + bool a = Prism::Input::IsGamepadButtonPressed(jid, Prism::GamepadButton::A); + ImGui::SetCursorScreenPos(ImVec2(base.x + buttonSize, base.y + 2*buttonSize)); + ImGui::PushStyleColor(ImGuiCol_Button, a ? ImVec4(0.0f,1.0f,0.0f,1.0f) : ImVec4(0.3f,0.3f,0.3f,1.0f)); + ImGui::Button("A", ImVec2(buttonSize, buttonSize)); + ImGui::PopStyleColor(); + + ImGui::SetCursorScreenPos(ImVec2(base.x, base.y + 3*buttonSize)); + ImGui::Dummy(ImVec2(3*buttonSize, 0)); + ImGui::EndGroup(); + }; + + // 右摇杆区域 + auto drawRightStick = [&](float x, float y) + { + y = -y; + ImGui::BeginGroup(); + ImGui::Text("R Stick"); + ImVec2 pos = ImGui::GetCursorScreenPos(); + ImVec2 center(pos.x + stickRadius, pos.y + stickRadius); + drawList->AddCircleFilled(center, stickRadius, IM_COL32(30,30,30,255)); + drawList->AddCircle(center, stickRadius, IM_COL32(100,100,100,255), 0, 2.0f); + drawList->AddLine(ImVec2(center.x - stickRadius, center.y), ImVec2(center.x + stickRadius, center.y), IM_COL32(70,70,70,255)); + drawList->AddLine(ImVec2(center.x, center.y - stickRadius), ImVec2(center.x, center.y + stickRadius), IM_COL32(70,70,70,255)); + + float len = sqrtf(x*x + y*y); + float clampX = x, clampY = y; + if (len > 1.0f) { clampX /= len; clampY /= len; } + float dotX = center.x + clampX * stickRadius; + float dotY = center.y - clampY * stickRadius; + drawList->AddCircleFilled(ImVec2(dotX, dotY), 6.0f, IM_COL32(255,80,80,255)); + if (len > 0.99f) + drawList->AddCircle(center, stickRadius, IM_COL32(255,255,0,150), 0, 3.0f); + + ImGui::Dummy(stickSize); + ImGui::EndGroup(); + }; + + // 获取摇杆当前值 + const float lx = Input::GetGamepadAxis(jid, GamepadAxis::LEFT_X); + const float ly = Input::GetGamepadAxis(jid, GamepadAxis::LEFT_Y); + const float rx = Input::GetGamepadAxis(jid, GamepadAxis::RIGHT_X); + const float ry = Input::GetGamepadAxis(jid, GamepadAxis::RIGHT_Y); + + // ----- 第一行:左摇杆 | 十字键 | ABXY | 右摇杆 ----- + ImGui::BeginGroup(); + // 缩进稍微调整 + ImGui::Columns(4, "MainControls", false); + ImGui::SetColumnWidth(0, stickSize.x + 10); + ImGui::SetColumnWidth(1, 3*dpadButtonSize + 10); + ImGui::SetColumnWidth(2, 3*buttonSize + 10); + ImGui::SetColumnWidth(3, stickSize.x + 10); + + drawStick("L Stick", lx, ly); + ImGui::NextColumn(); + drawDPad(); + ImGui::NextColumn(); + drawABXY(); + ImGui::NextColumn(); + drawRightStick(rx, ry); + ImGui::Columns(1); + ImGui::EndGroup(); + + ImGui::Spacing(); + + // ----- 第二行:肩键 LB/RB 和扳机轴 ----- + ImGui::Text("Bumpers & Triggers"); + bool lb = Input::IsGamepadButtonPressed(jid, Prism::GamepadButton::LEFT_BUMPER); + bool rb = Input::IsGamepadButtonPressed(jid, Prism::GamepadButton::RIGHT_BUMPER); + float lt = Input::GetGamepadAxis(jid, Prism::GamepadAxis::LEFT_TRIGGER); + float rt = Input::GetGamepadAxis(jid, Prism::GamepadAxis::RIGHT_TRIGGER); + + ImGui::BeginGroup(); + ImGui::PushStyleColor(ImGuiCol_Button, lb ? ImVec4(0.0f,1.0f,0.0f,1.0f) : ImVec4(0.3f,0.3f,0.3f,1.0f)); + ImGui::Button("LB", ImVec2(40, 20)); + ImGui::PopStyleColor(); + ImGui::SameLine(); + ImGui::ProgressBar(lt, ImVec2(100, 20), ""); + ImGui::SameLine(); + ImGui::Text("LT %.2f", lt); + + ImGui::SameLine(0, 30); + + ImGui::ProgressBar(rt, ImVec2(100, 20), ""); + ImGui::SameLine(); + ImGui::Text("RT %.2f", rt); + ImGui::SameLine(); + ImGui::PushStyleColor(ImGuiCol_Button, rb ? ImVec4(0.0f,1.0f,0.0f,1.0f) : ImVec4(0.3f,0.3f,0.3f,1.0f)); + ImGui::Button("RB", ImVec2(40, 20)); + ImGui::PopStyleColor(); + ImGui::EndGroup(); + + ImGui::Spacing(); + + // ----- 第三行:功能键 Back, Guide, Start, LThumb, RThumb ----- + ImGui::Text("Function Keys"); + auto drawFuncBtn = [&](const char* label, Prism::GamepadButton btn) + { + bool pressed = Input::IsGamepadButtonPressed(jid, btn); + ImGui::PushStyleColor(ImGuiCol_Button, pressed ? ImVec4(0.0f,1.0f,0.0f,1.0f) : ImVec4(0.3f,0.3f,0.3f,1.0f)); + ImGui::Button(label, ImVec2(60, 25)); + ImGui::PopStyleColor(); + ImGui::SameLine(0, 4); + }; + + drawFuncBtn("Back", GamepadButton::BACK); + drawFuncBtn("Guide", GamepadButton::GUIDE); + drawFuncBtn("Start", GamepadButton::START); + ImGui::SameLine(0, 20); + drawFuncBtn("LThumb", GamepadButton::LEFT_THUMB); + drawFuncBtn("RThumb", GamepadButton::RIGHT_THUMB); + ImGui::NewLine(); + + ImGui::TreePop(); + } + } + + if (!anyConnected) + ImGui::Text("No gamepads connected."); + + ImGui::End(); + } + std::pair EditorLayer::GetMouseViewportSpace() const { auto [mx, my] = ImGui::GetMousePos(); // Input::GetMousePosition(); @@ -1302,7 +1550,7 @@ namespace Prism m_SceneState = SceneState::Play; if (m_ReloadScriptOnPlay) - ScriptEngine::ReloadAssembly("assets/scripts/ExampleApp.dll"); + ScriptEngine::ReloadAssembly("assets/Scripts/Assembly-CSharp.dll"); m_RuntimeScene = Ref::Create(); m_EditorScene->CopyTo(m_RuntimeScene); diff --git a/Editor/Editor/EditorLayer.h b/Editor/Editor/EditorLayer.h index 071f587..3df124e 100644 --- a/Editor/Editor/EditorLayer.h +++ b/Editor/Editor/EditorLayer.h @@ -33,6 +33,10 @@ namespace Prism void SelectEntity(Entity entity); void UpdateWindowTitle(const std::string& sceneName); + + // GamePad Utils + void DrawGamepadDebugPanel(bool& p_open); + private: std::pair GetMouseViewportSpace() const; std::pair CastRay(float mx, float my); @@ -145,6 +149,7 @@ namespace Prism bool m_ViewportPanelHovered = false; bool m_ViewportPanelFocused = false; bool m_ShowPhysicsSettings = false; + bool m_ShowGamePadSettings = false; enum class SceneState { diff --git a/Editor/assets/meshes/Default/Sphere.fbx b/Editor/assets/meshes/Default/Sphere.fbx index 981eefc..63f08ed 100644 Binary files a/Editor/assets/meshes/Default/Sphere.fbx and b/Editor/assets/meshes/Default/Sphere.fbx differ diff --git a/Editor/assets/shaders/PBRShader_Static.glsl b/Editor/assets/shaders/PBRShader_Static.glsl index 51c45ac..63c0082 100644 --- a/Editor/assets/shaders/PBRShader_Static.glsl +++ b/Editor/assets/shaders/PBRShader_Static.glsl @@ -454,7 +454,7 @@ void main() vec3 iblContribution = IBL(F0, Lr) * u_IBLContribution; - color = vec4(lightContribution + iblContribution, m_Params.Albedo.a); + color = vec4(lightContribution + iblContribution, 1.0); // Bloom float brightness = dot(color.rgb, vec3(0.2126, 0.7152, 0.0722)); diff --git a/Editor/library/mono/4.5/Facades/Microsoft.Win32.Primitives.dll b/Editor/library/mono/lib/mono/4.5/Facades/Microsoft.Win32.Primitives.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/Microsoft.Win32.Primitives.dll rename to Editor/library/mono/lib/mono/4.5/Facades/Microsoft.Win32.Primitives.dll diff --git a/Editor/library/mono/4.5/Facades/Microsoft.Win32.Registry.AccessControl.dll b/Editor/library/mono/lib/mono/4.5/Facades/Microsoft.Win32.Registry.AccessControl.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/Microsoft.Win32.Registry.AccessControl.dll rename to Editor/library/mono/lib/mono/4.5/Facades/Microsoft.Win32.Registry.AccessControl.dll diff --git a/Editor/library/mono/4.5/Facades/Microsoft.Win32.Registry.dll b/Editor/library/mono/lib/mono/4.5/Facades/Microsoft.Win32.Registry.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/Microsoft.Win32.Registry.dll rename to Editor/library/mono/lib/mono/4.5/Facades/Microsoft.Win32.Registry.dll diff --git a/Editor/library/mono/4.5/Facades/System.AppContext.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.AppContext.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.AppContext.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.AppContext.dll diff --git a/Editor/library/mono/4.5/Facades/System.Collections.Concurrent.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Collections.Concurrent.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Collections.Concurrent.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Collections.Concurrent.dll diff --git a/Editor/library/mono/4.5/Facades/System.Collections.NonGeneric.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Collections.NonGeneric.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Collections.NonGeneric.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Collections.NonGeneric.dll diff --git a/Editor/library/mono/4.5/Facades/System.Collections.Specialized.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Collections.Specialized.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Collections.Specialized.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Collections.Specialized.dll diff --git a/Editor/library/mono/4.5/Facades/System.Collections.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Collections.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Collections.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Collections.dll diff --git a/Editor/library/mono/4.5/Facades/System.ComponentModel.Annotations.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ComponentModel.Annotations.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ComponentModel.Annotations.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ComponentModel.Annotations.dll diff --git a/Editor/library/mono/4.5/Facades/System.ComponentModel.EventBasedAsync.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ComponentModel.EventBasedAsync.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ComponentModel.EventBasedAsync.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ComponentModel.EventBasedAsync.dll diff --git a/Editor/library/mono/4.5/Facades/System.ComponentModel.Primitives.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ComponentModel.Primitives.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ComponentModel.Primitives.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ComponentModel.Primitives.dll diff --git a/Editor/library/mono/4.5/Facades/System.ComponentModel.TypeConverter.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ComponentModel.TypeConverter.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ComponentModel.TypeConverter.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ComponentModel.TypeConverter.dll diff --git a/Editor/library/mono/4.5/Facades/System.ComponentModel.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ComponentModel.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ComponentModel.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ComponentModel.dll diff --git a/Editor/library/mono/4.5/Facades/System.Console.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Console.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Console.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Console.dll diff --git a/Editor/library/mono/4.5/Facades/System.Data.Common.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Data.Common.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Data.Common.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Data.Common.dll diff --git a/Editor/library/mono/4.5/Facades/System.Data.SqlClient.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Data.SqlClient.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Data.SqlClient.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Data.SqlClient.dll diff --git a/Editor/library/mono/4.5/Facades/System.Diagnostics.Contracts.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.Contracts.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Diagnostics.Contracts.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.Contracts.dll diff --git a/Editor/library/mono/4.5/Facades/System.Diagnostics.Debug.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.Debug.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Diagnostics.Debug.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.Debug.dll diff --git a/Editor/library/mono/4.5/Facades/System.Diagnostics.FileVersionInfo.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.FileVersionInfo.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Diagnostics.FileVersionInfo.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.FileVersionInfo.dll diff --git a/Editor/library/mono/4.5/Facades/System.Diagnostics.Process.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.Process.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Diagnostics.Process.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.Process.dll diff --git a/Editor/library/mono/4.5/Facades/System.Diagnostics.StackTrace.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.StackTrace.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Diagnostics.StackTrace.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.StackTrace.dll diff --git a/Editor/library/mono/4.5/Facades/System.Diagnostics.TextWriterTraceListener.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.TextWriterTraceListener.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Diagnostics.TextWriterTraceListener.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.TextWriterTraceListener.dll diff --git a/Editor/library/mono/4.5/Facades/System.Diagnostics.Tools.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.Tools.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Diagnostics.Tools.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.Tools.dll diff --git a/Editor/library/mono/4.5/Facades/System.Diagnostics.TraceEvent.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.TraceEvent.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Diagnostics.TraceEvent.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.TraceEvent.dll diff --git a/Editor/library/mono/4.5/Facades/System.Diagnostics.TraceSource.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.TraceSource.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Diagnostics.TraceSource.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.TraceSource.dll diff --git a/Editor/library/mono/4.5/Facades/System.Diagnostics.Tracing.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.Tracing.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Diagnostics.Tracing.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Diagnostics.Tracing.dll diff --git a/Editor/library/mono/4.5/Facades/System.Drawing.Primitives.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Drawing.Primitives.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Drawing.Primitives.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Drawing.Primitives.dll diff --git a/Editor/library/mono/4.5/Facades/System.Dynamic.Runtime.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Dynamic.Runtime.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Dynamic.Runtime.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Dynamic.Runtime.dll diff --git a/Editor/library/mono/4.5/Facades/System.Globalization.Calendars.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Globalization.Calendars.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Globalization.Calendars.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Globalization.Calendars.dll diff --git a/Editor/library/mono/4.5/Facades/System.Globalization.Extensions.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Globalization.Extensions.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Globalization.Extensions.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Globalization.Extensions.dll diff --git a/Editor/library/mono/4.5/Facades/System.Globalization.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Globalization.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Globalization.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Globalization.dll diff --git a/Editor/library/mono/4.5/Facades/System.IO.Compression.ZipFile.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.IO.Compression.ZipFile.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.IO.Compression.ZipFile.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.IO.Compression.ZipFile.dll diff --git a/Editor/library/mono/4.5/Facades/System.IO.FileSystem.AccessControl.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.IO.FileSystem.AccessControl.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.IO.FileSystem.AccessControl.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.IO.FileSystem.AccessControl.dll diff --git a/Editor/library/mono/4.5/Facades/System.IO.FileSystem.DriveInfo.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.IO.FileSystem.DriveInfo.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.IO.FileSystem.DriveInfo.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.IO.FileSystem.DriveInfo.dll diff --git a/Editor/library/mono/4.5/Facades/System.IO.FileSystem.Primitives.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.IO.FileSystem.Primitives.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.IO.FileSystem.Primitives.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.IO.FileSystem.Primitives.dll diff --git a/Editor/library/mono/4.5/Facades/System.IO.FileSystem.Watcher.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.IO.FileSystem.Watcher.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.IO.FileSystem.Watcher.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.IO.FileSystem.Watcher.dll diff --git a/Editor/library/mono/4.5/Facades/System.IO.FileSystem.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.IO.FileSystem.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.IO.FileSystem.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.IO.FileSystem.dll diff --git a/Editor/library/mono/4.5/Facades/System.IO.IsolatedStorage.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.IO.IsolatedStorage.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.IO.IsolatedStorage.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.IO.IsolatedStorage.dll diff --git a/Editor/library/mono/4.5/Facades/System.IO.MemoryMappedFiles.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.IO.MemoryMappedFiles.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.IO.MemoryMappedFiles.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.IO.MemoryMappedFiles.dll diff --git a/Editor/library/mono/4.5/Facades/System.IO.Pipes.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.IO.Pipes.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.IO.Pipes.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.IO.Pipes.dll diff --git a/Editor/library/mono/4.5/Facades/System.IO.UnmanagedMemoryStream.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.IO.UnmanagedMemoryStream.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.IO.UnmanagedMemoryStream.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.IO.UnmanagedMemoryStream.dll diff --git a/Editor/library/mono/4.5/Facades/System.IO.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.IO.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.IO.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.IO.dll diff --git a/Editor/library/mono/4.5/Facades/System.Linq.Expressions.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Linq.Expressions.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Linq.Expressions.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Linq.Expressions.dll diff --git a/Editor/library/mono/4.5/Facades/System.Linq.Parallel.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Linq.Parallel.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Linq.Parallel.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Linq.Parallel.dll diff --git a/Editor/library/mono/4.5/Facades/System.Linq.Queryable.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Linq.Queryable.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Linq.Queryable.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Linq.Queryable.dll diff --git a/Editor/library/mono/4.5/Facades/System.Linq.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Linq.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Linq.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Linq.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.AuthenticationManager.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.AuthenticationManager.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.AuthenticationManager.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.AuthenticationManager.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.Cache.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.Cache.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.Cache.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.Cache.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.Http.Rtc.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.Http.Rtc.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.Http.Rtc.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.Http.Rtc.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.HttpListener.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.HttpListener.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.HttpListener.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.HttpListener.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.Mail.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.Mail.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.Mail.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.Mail.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.NameResolution.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.NameResolution.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.NameResolution.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.NameResolution.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.NetworkInformation.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.NetworkInformation.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.NetworkInformation.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.NetworkInformation.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.Ping.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.Ping.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.Ping.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.Ping.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.Primitives.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.Primitives.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.Primitives.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.Primitives.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.Requests.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.Requests.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.Requests.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.Requests.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.Security.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.Security.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.Security.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.Security.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.ServicePoint.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.ServicePoint.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.ServicePoint.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.ServicePoint.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.Sockets.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.Sockets.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.Sockets.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.Sockets.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.Utilities.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.Utilities.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.Utilities.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.Utilities.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.WebHeaderCollection.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.WebHeaderCollection.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.WebHeaderCollection.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.WebHeaderCollection.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.WebSockets.Client.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.WebSockets.Client.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.WebSockets.Client.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.WebSockets.Client.dll diff --git a/Editor/library/mono/4.5/Facades/System.Net.WebSockets.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Net.WebSockets.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Net.WebSockets.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Net.WebSockets.dll diff --git a/Editor/library/mono/4.5/Facades/System.ObjectModel.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ObjectModel.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ObjectModel.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ObjectModel.dll diff --git a/Editor/library/mono/4.5/Facades/System.Reflection.Emit.ILGeneration.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.Emit.ILGeneration.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Reflection.Emit.ILGeneration.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.Emit.ILGeneration.dll diff --git a/Editor/library/mono/4.5/Facades/System.Reflection.Emit.Lightweight.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.Emit.Lightweight.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Reflection.Emit.Lightweight.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.Emit.Lightweight.dll diff --git a/Editor/library/mono/4.5/Facades/System.Reflection.Emit.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.Emit.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Reflection.Emit.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.Emit.dll diff --git a/Editor/library/mono/4.5/Facades/System.Reflection.Extensions.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.Extensions.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Reflection.Extensions.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.Extensions.dll diff --git a/Editor/library/mono/4.5/Facades/System.Reflection.Primitives.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.Primitives.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Reflection.Primitives.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.Primitives.dll diff --git a/Editor/library/mono/4.5/Facades/System.Reflection.TypeExtensions.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.TypeExtensions.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Reflection.TypeExtensions.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.TypeExtensions.dll diff --git a/Editor/library/mono/4.5/Facades/System.Reflection.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Reflection.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Reflection.dll diff --git a/Editor/library/mono/4.5/Facades/System.Resources.Reader.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Resources.Reader.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Resources.Reader.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Resources.Reader.dll diff --git a/Editor/library/mono/4.5/Facades/System.Resources.ReaderWriter.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Resources.ReaderWriter.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Resources.ReaderWriter.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Resources.ReaderWriter.dll diff --git a/Editor/library/mono/4.5/Facades/System.Resources.ResourceManager.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Resources.ResourceManager.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Resources.ResourceManager.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Resources.ResourceManager.dll diff --git a/Editor/library/mono/4.5/Facades/System.Resources.Writer.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Resources.Writer.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Resources.Writer.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Resources.Writer.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.CompilerServices.VisualC.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.CompilerServices.VisualC.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.CompilerServices.VisualC.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.CompilerServices.VisualC.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.Extensions.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Extensions.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.Extensions.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Extensions.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.Handles.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Handles.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.Handles.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Handles.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.InteropServices.RuntimeInformation.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.InteropServices.RuntimeInformation.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.InteropServices.RuntimeInformation.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.InteropServices.RuntimeInformation.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.InteropServices.WindowsRuntime.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.InteropServices.WindowsRuntime.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.InteropServices.WindowsRuntime.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.InteropServices.WindowsRuntime.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.InteropServices.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.InteropServices.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.InteropServices.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.InteropServices.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.Numerics.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Numerics.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.Numerics.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Numerics.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.Serialization.Formatters.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Serialization.Formatters.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.Serialization.Formatters.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Serialization.Formatters.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.Serialization.Json.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Serialization.Json.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.Serialization.Json.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Serialization.Json.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.Serialization.Primitives.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Serialization.Primitives.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.Serialization.Primitives.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Serialization.Primitives.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.Serialization.Xml.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Serialization.Xml.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.Serialization.Xml.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.Serialization.Xml.dll diff --git a/Editor/library/mono/4.5/Facades/System.Runtime.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Runtime.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Runtime.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.AccessControl.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.AccessControl.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.AccessControl.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.AccessControl.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Claims.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Claims.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Claims.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Claims.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.Algorithms.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Algorithms.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.Algorithms.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Algorithms.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.Csp.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Csp.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.Csp.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Csp.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.DeriveBytes.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.DeriveBytes.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.DeriveBytes.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.DeriveBytes.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.Encoding.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Encoding.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.Encoding.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Encoding.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.Encryption.Aes.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Encryption.Aes.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.Encryption.Aes.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Encryption.Aes.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.Encryption.ECDsa.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Encryption.ECDsa.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.Encryption.ECDsa.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Encryption.ECDsa.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.Encryption.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Encryption.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.Encryption.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Encryption.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.Hashing.Algorithms.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Hashing.Algorithms.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.Hashing.Algorithms.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Hashing.Algorithms.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.Hashing.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Hashing.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.Hashing.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Hashing.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.Primitives.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Primitives.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.Primitives.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.Primitives.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.ProtectedData.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.ProtectedData.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.ProtectedData.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.ProtectedData.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.RSA.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.RSA.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.RSA.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.RSA.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.RandomNumberGenerator.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.RandomNumberGenerator.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.RandomNumberGenerator.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.RandomNumberGenerator.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Cryptography.X509Certificates.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.X509Certificates.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Cryptography.X509Certificates.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Cryptography.X509Certificates.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Principal.Windows.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Principal.Windows.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Principal.Windows.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Principal.Windows.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.Principal.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.Principal.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.Principal.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.Principal.dll diff --git a/Editor/library/mono/4.5/Facades/System.Security.SecureString.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Security.SecureString.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Security.SecureString.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Security.SecureString.dll diff --git a/Editor/library/mono/4.5/Facades/System.ServiceModel.Duplex.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ServiceModel.Duplex.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ServiceModel.Duplex.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ServiceModel.Duplex.dll diff --git a/Editor/library/mono/4.5/Facades/System.ServiceModel.Http.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ServiceModel.Http.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ServiceModel.Http.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ServiceModel.Http.dll diff --git a/Editor/library/mono/4.5/Facades/System.ServiceModel.NetTcp.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ServiceModel.NetTcp.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ServiceModel.NetTcp.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ServiceModel.NetTcp.dll diff --git a/Editor/library/mono/4.5/Facades/System.ServiceModel.Primitives.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ServiceModel.Primitives.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ServiceModel.Primitives.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ServiceModel.Primitives.dll diff --git a/Editor/library/mono/4.5/Facades/System.ServiceModel.Security.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ServiceModel.Security.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ServiceModel.Security.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ServiceModel.Security.dll diff --git a/Editor/library/mono/4.5/Facades/System.ServiceProcess.ServiceController.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ServiceProcess.ServiceController.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ServiceProcess.ServiceController.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ServiceProcess.ServiceController.dll diff --git a/Editor/library/mono/4.5/Facades/System.Text.Encoding.CodePages.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Text.Encoding.CodePages.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Text.Encoding.CodePages.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Text.Encoding.CodePages.dll diff --git a/Editor/library/mono/4.5/Facades/System.Text.Encoding.Extensions.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Text.Encoding.Extensions.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Text.Encoding.Extensions.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Text.Encoding.Extensions.dll diff --git a/Editor/library/mono/4.5/Facades/System.Text.Encoding.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Text.Encoding.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Text.Encoding.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Text.Encoding.dll diff --git a/Editor/library/mono/4.5/Facades/System.Text.RegularExpressions.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Text.RegularExpressions.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Text.RegularExpressions.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Text.RegularExpressions.dll diff --git a/Editor/library/mono/4.5/Facades/System.Threading.AccessControl.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Threading.AccessControl.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Threading.AccessControl.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Threading.AccessControl.dll diff --git a/Editor/library/mono/4.5/Facades/System.Threading.Overlapped.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Threading.Overlapped.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Threading.Overlapped.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Threading.Overlapped.dll diff --git a/Editor/library/mono/4.5/Facades/System.Threading.Tasks.Parallel.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Threading.Tasks.Parallel.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Threading.Tasks.Parallel.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Threading.Tasks.Parallel.dll diff --git a/Editor/library/mono/4.5/Facades/System.Threading.Tasks.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Threading.Tasks.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Threading.Tasks.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Threading.Tasks.dll diff --git a/Editor/library/mono/4.5/Facades/System.Threading.Thread.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Threading.Thread.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Threading.Thread.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Threading.Thread.dll diff --git a/Editor/library/mono/4.5/Facades/System.Threading.ThreadPool.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Threading.ThreadPool.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Threading.ThreadPool.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Threading.ThreadPool.dll diff --git a/Editor/library/mono/4.5/Facades/System.Threading.Timer.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Threading.Timer.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Threading.Timer.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Threading.Timer.dll diff --git a/Editor/library/mono/4.5/Facades/System.Threading.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Threading.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Threading.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Threading.dll diff --git a/Editor/library/mono/4.5/Facades/System.ValueTuple.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.ValueTuple.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.ValueTuple.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.ValueTuple.dll diff --git a/Editor/library/mono/4.5/Facades/System.Xml.ReaderWriter.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Xml.ReaderWriter.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Xml.ReaderWriter.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Xml.ReaderWriter.dll diff --git a/Editor/library/mono/4.5/Facades/System.Xml.XDocument.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Xml.XDocument.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Xml.XDocument.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Xml.XDocument.dll diff --git a/Editor/library/mono/4.5/Facades/System.Xml.XPath.XDocument.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Xml.XPath.XDocument.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Xml.XPath.XDocument.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Xml.XPath.XDocument.dll diff --git a/Editor/library/mono/4.5/Facades/System.Xml.XPath.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Xml.XPath.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Xml.XPath.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Xml.XPath.dll diff --git a/Editor/library/mono/4.5/Facades/System.Xml.XmlDocument.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Xml.XmlDocument.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Xml.XmlDocument.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Xml.XmlDocument.dll diff --git a/Editor/library/mono/4.5/Facades/System.Xml.XmlSerializer.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Xml.XmlSerializer.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Xml.XmlSerializer.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Xml.XmlSerializer.dll diff --git a/Editor/library/mono/4.5/Facades/System.Xml.Xsl.Primitives.dll b/Editor/library/mono/lib/mono/4.5/Facades/System.Xml.Xsl.Primitives.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/System.Xml.Xsl.Primitives.dll rename to Editor/library/mono/lib/mono/4.5/Facades/System.Xml.Xsl.Primitives.dll diff --git a/Editor/library/mono/4.5/Facades/netstandard.dll b/Editor/library/mono/lib/mono/4.5/Facades/netstandard.dll similarity index 100% rename from Editor/library/mono/4.5/Facades/netstandard.dll rename to Editor/library/mono/lib/mono/4.5/Facades/netstandard.dll diff --git a/Editor/library/mono/4.5/Microsoft.Build.xsd b/Editor/library/mono/lib/mono/4.5/Microsoft.Build.xsd similarity index 100% rename from Editor/library/mono/4.5/Microsoft.Build.xsd rename to Editor/library/mono/lib/mono/4.5/Microsoft.Build.xsd diff --git a/Editor/library/mono/4.5/Microsoft.CSharp.targets b/Editor/library/mono/lib/mono/4.5/Microsoft.CSharp.targets similarity index 100% rename from Editor/library/mono/4.5/Microsoft.CSharp.targets rename to Editor/library/mono/lib/mono/4.5/Microsoft.CSharp.targets diff --git a/Editor/library/mono/4.5/Microsoft.Common.targets b/Editor/library/mono/lib/mono/4.5/Microsoft.Common.targets similarity index 100% rename from Editor/library/mono/4.5/Microsoft.Common.targets rename to Editor/library/mono/lib/mono/4.5/Microsoft.Common.targets diff --git a/Editor/library/mono/4.5/Microsoft.Common.tasks b/Editor/library/mono/lib/mono/4.5/Microsoft.Common.tasks similarity index 100% rename from Editor/library/mono/4.5/Microsoft.Common.tasks rename to Editor/library/mono/lib/mono/4.5/Microsoft.Common.tasks diff --git a/Editor/library/mono/4.5/Microsoft.VisualBasic.dll b/Editor/library/mono/lib/mono/4.5/Microsoft.VisualBasic.dll similarity index 100% rename from Editor/library/mono/4.5/Microsoft.VisualBasic.dll rename to Editor/library/mono/lib/mono/4.5/Microsoft.VisualBasic.dll diff --git a/Editor/library/mono/4.5/Microsoft.VisualBasic.targets b/Editor/library/mono/lib/mono/4.5/Microsoft.VisualBasic.targets similarity index 100% rename from Editor/library/mono/4.5/Microsoft.VisualBasic.targets rename to Editor/library/mono/lib/mono/4.5/Microsoft.VisualBasic.targets diff --git a/Editor/library/mono/4.5/Microsoft.VisualC.dll b/Editor/library/mono/lib/mono/4.5/Microsoft.VisualC.dll similarity index 100% rename from Editor/library/mono/4.5/Microsoft.VisualC.dll rename to Editor/library/mono/lib/mono/4.5/Microsoft.VisualC.dll diff --git a/Editor/library/mono/4.5/System.ComponentModel.Composition.dll b/Editor/library/mono/lib/mono/4.5/System.ComponentModel.Composition.dll similarity index 100% rename from Editor/library/mono/4.5/System.ComponentModel.Composition.dll rename to Editor/library/mono/lib/mono/4.5/System.ComponentModel.Composition.dll diff --git a/Editor/library/mono/4.5/System.ComponentModel.DataAnnotations.dll b/Editor/library/mono/lib/mono/4.5/System.ComponentModel.DataAnnotations.dll similarity index 100% rename from Editor/library/mono/4.5/System.ComponentModel.DataAnnotations.dll rename to Editor/library/mono/lib/mono/4.5/System.ComponentModel.DataAnnotations.dll diff --git a/Editor/library/mono/4.5/System.Configuration.Install.dll b/Editor/library/mono/lib/mono/4.5/System.Configuration.Install.dll similarity index 100% rename from Editor/library/mono/4.5/System.Configuration.Install.dll rename to Editor/library/mono/lib/mono/4.5/System.Configuration.Install.dll diff --git a/Editor/library/mono/4.5/System.Configuration.dll b/Editor/library/mono/lib/mono/4.5/System.Configuration.dll similarity index 100% rename from Editor/library/mono/4.5/System.Configuration.dll rename to Editor/library/mono/lib/mono/4.5/System.Configuration.dll diff --git a/Editor/library/mono/4.5/System.Core.dll b/Editor/library/mono/lib/mono/4.5/System.Core.dll similarity index 100% rename from Editor/library/mono/4.5/System.Core.dll rename to Editor/library/mono/lib/mono/4.5/System.Core.dll diff --git a/Editor/library/mono/4.5/System.Data.DataSetExtensions.dll b/Editor/library/mono/lib/mono/4.5/System.Data.DataSetExtensions.dll similarity index 100% rename from Editor/library/mono/4.5/System.Data.DataSetExtensions.dll rename to Editor/library/mono/lib/mono/4.5/System.Data.DataSetExtensions.dll diff --git a/Editor/library/mono/4.5/System.Data.Services.Client.dll b/Editor/library/mono/lib/mono/4.5/System.Data.Services.Client.dll similarity index 100% rename from Editor/library/mono/4.5/System.Data.Services.Client.dll rename to Editor/library/mono/lib/mono/4.5/System.Data.Services.Client.dll diff --git a/Editor/library/mono/4.5/System.Data.Services.dll b/Editor/library/mono/lib/mono/4.5/System.Data.Services.dll similarity index 100% rename from Editor/library/mono/4.5/System.Data.Services.dll rename to Editor/library/mono/lib/mono/4.5/System.Data.Services.dll diff --git a/Editor/library/mono/4.5/System.Data.dll b/Editor/library/mono/lib/mono/4.5/System.Data.dll similarity index 100% rename from Editor/library/mono/4.5/System.Data.dll rename to Editor/library/mono/lib/mono/4.5/System.Data.dll diff --git a/Editor/library/mono/4.5/System.Deployment.dll b/Editor/library/mono/lib/mono/4.5/System.Deployment.dll similarity index 100% rename from Editor/library/mono/4.5/System.Deployment.dll rename to Editor/library/mono/lib/mono/4.5/System.Deployment.dll diff --git a/Editor/library/mono/4.5/System.Dynamic.dll b/Editor/library/mono/lib/mono/4.5/System.Dynamic.dll similarity index 100% rename from Editor/library/mono/4.5/System.Dynamic.dll rename to Editor/library/mono/lib/mono/4.5/System.Dynamic.dll diff --git a/Editor/library/mono/4.5/System.IO.Compression.FileSystem.dll b/Editor/library/mono/lib/mono/4.5/System.IO.Compression.FileSystem.dll similarity index 100% rename from Editor/library/mono/4.5/System.IO.Compression.FileSystem.dll rename to Editor/library/mono/lib/mono/4.5/System.IO.Compression.FileSystem.dll diff --git a/Editor/library/mono/4.5/System.IO.Compression.dll b/Editor/library/mono/lib/mono/4.5/System.IO.Compression.dll similarity index 100% rename from Editor/library/mono/4.5/System.IO.Compression.dll rename to Editor/library/mono/lib/mono/4.5/System.IO.Compression.dll diff --git a/Editor/library/mono/4.5/System.Json.Microsoft.dll b/Editor/library/mono/lib/mono/4.5/System.Json.Microsoft.dll similarity index 100% rename from Editor/library/mono/4.5/System.Json.Microsoft.dll rename to Editor/library/mono/lib/mono/4.5/System.Json.Microsoft.dll diff --git a/Editor/library/mono/4.5/System.Json.dll b/Editor/library/mono/lib/mono/4.5/System.Json.dll similarity index 100% rename from Editor/library/mono/4.5/System.Json.dll rename to Editor/library/mono/lib/mono/4.5/System.Json.dll diff --git a/Editor/library/mono/4.5/System.Management.dll b/Editor/library/mono/lib/mono/4.5/System.Management.dll similarity index 100% rename from Editor/library/mono/4.5/System.Management.dll rename to Editor/library/mono/lib/mono/4.5/System.Management.dll diff --git a/Editor/library/mono/4.5/System.Net.Http.WebRequest.dll b/Editor/library/mono/lib/mono/4.5/System.Net.Http.WebRequest.dll similarity index 100% rename from Editor/library/mono/4.5/System.Net.Http.WebRequest.dll rename to Editor/library/mono/lib/mono/4.5/System.Net.Http.WebRequest.dll diff --git a/Editor/library/mono/4.5/System.Net.Http.dll b/Editor/library/mono/lib/mono/4.5/System.Net.Http.dll similarity index 100% rename from Editor/library/mono/4.5/System.Net.Http.dll rename to Editor/library/mono/lib/mono/4.5/System.Net.Http.dll diff --git a/Editor/library/mono/4.5/System.Net.dll b/Editor/library/mono/lib/mono/4.5/System.Net.dll similarity index 100% rename from Editor/library/mono/4.5/System.Net.dll rename to Editor/library/mono/lib/mono/4.5/System.Net.dll diff --git a/Editor/library/mono/4.5/System.Numerics.Vectors.dll b/Editor/library/mono/lib/mono/4.5/System.Numerics.Vectors.dll similarity index 100% rename from Editor/library/mono/4.5/System.Numerics.Vectors.dll rename to Editor/library/mono/lib/mono/4.5/System.Numerics.Vectors.dll diff --git a/Editor/library/mono/4.5/System.Numerics.dll b/Editor/library/mono/lib/mono/4.5/System.Numerics.dll similarity index 100% rename from Editor/library/mono/4.5/System.Numerics.dll rename to Editor/library/mono/lib/mono/4.5/System.Numerics.dll diff --git a/Editor/library/mono/4.5/System.Runtime.Serialization.Formatters.Soap.dll b/Editor/library/mono/lib/mono/4.5/System.Runtime.Serialization.Formatters.Soap.dll similarity index 100% rename from Editor/library/mono/4.5/System.Runtime.Serialization.Formatters.Soap.dll rename to Editor/library/mono/lib/mono/4.5/System.Runtime.Serialization.Formatters.Soap.dll diff --git a/Editor/library/mono/4.5/System.Runtime.Serialization.dll b/Editor/library/mono/lib/mono/4.5/System.Runtime.Serialization.dll similarity index 100% rename from Editor/library/mono/4.5/System.Runtime.Serialization.dll rename to Editor/library/mono/lib/mono/4.5/System.Runtime.Serialization.dll diff --git a/Editor/library/mono/4.5/System.Security.dll b/Editor/library/mono/lib/mono/4.5/System.Security.dll similarity index 100% rename from Editor/library/mono/4.5/System.Security.dll rename to Editor/library/mono/lib/mono/4.5/System.Security.dll diff --git a/Editor/library/mono/4.5/System.Web.dll b/Editor/library/mono/lib/mono/4.5/System.Web.dll similarity index 100% rename from Editor/library/mono/4.5/System.Web.dll rename to Editor/library/mono/lib/mono/4.5/System.Web.dll diff --git a/Editor/library/mono/4.5/System.Xml.Linq.dll b/Editor/library/mono/lib/mono/4.5/System.Xml.Linq.dll similarity index 100% rename from Editor/library/mono/4.5/System.Xml.Linq.dll rename to Editor/library/mono/lib/mono/4.5/System.Xml.Linq.dll diff --git a/Editor/library/mono/4.5/System.Xml.Serialization.dll b/Editor/library/mono/lib/mono/4.5/System.Xml.Serialization.dll similarity index 100% rename from Editor/library/mono/4.5/System.Xml.Serialization.dll rename to Editor/library/mono/lib/mono/4.5/System.Xml.Serialization.dll diff --git a/Editor/library/mono/4.5/System.Xml.dll b/Editor/library/mono/lib/mono/4.5/System.Xml.dll similarity index 100% rename from Editor/library/mono/4.5/System.Xml.dll rename to Editor/library/mono/lib/mono/4.5/System.Xml.dll diff --git a/Editor/library/mono/4.5/System.dll b/Editor/library/mono/lib/mono/4.5/System.dll similarity index 100% rename from Editor/library/mono/4.5/System.dll rename to Editor/library/mono/lib/mono/4.5/System.dll diff --git a/Editor/library/mono/4.5/WebMatrix.Data.dll b/Editor/library/mono/lib/mono/4.5/WebMatrix.Data.dll similarity index 100% rename from Editor/library/mono/4.5/WebMatrix.Data.dll rename to Editor/library/mono/lib/mono/4.5/WebMatrix.Data.dll diff --git a/Editor/library/mono/4.5/cscompmgd.dll b/Editor/library/mono/lib/mono/4.5/cscompmgd.dll similarity index 100% rename from Editor/library/mono/4.5/cscompmgd.dll rename to Editor/library/mono/lib/mono/4.5/cscompmgd.dll diff --git a/Editor/library/mono/lib/mono/4.5/mcs.exe b/Editor/library/mono/lib/mono/4.5/mcs.exe new file mode 100644 index 0000000..3ccd3e2 Binary files /dev/null and b/Editor/library/mono/lib/mono/4.5/mcs.exe differ diff --git a/Editor/library/mono/4.5/mscorlib.dll b/Editor/library/mono/lib/mono/4.5/mscorlib.dll similarity index 100% rename from Editor/library/mono/4.5/mscorlib.dll rename to Editor/library/mono/lib/mono/4.5/mscorlib.dll diff --git a/Prism-ScriptCore/Src/Prism/Input.cs b/Prism-ScriptCore/Src/Prism/Input.cs index 65aceb8..6a80d75 100644 --- a/Prism-ScriptCore/Src/Prism/Input.cs +++ b/Prism-ScriptCore/Src/Prism/Input.cs @@ -8,9 +8,9 @@ namespace Prism { Normal = 0, Hidden = 1, - Locked = 2, + Locked = 2, } - + public enum MouseButton { Button0 = 0, @@ -23,7 +23,36 @@ namespace Prism Right = Button1, Middle = Button2 } - + + public enum GamepadButton + { + A = 0, + B = 1, + X = 2, + Y = 3, + LeftBumper = 4, + RightBumper = 5, + Back = 6, + Start = 7, + Guide = 8, + LeftThumb = 9, + RightThumb = 10, + DpadUp = 11, + DpadRight = 12, + DpadDown = 13, + DpadLeft = 14 + } + + public enum GamepadAxis + { + LeftX = 0, + LeftY = 1, + RightX = 2, + RightY = 3, + LeftTrigger = 4, + RightTrigger = 5 + } + public static bool IsKeyPressed(KeyCode keycode) { @@ -44,7 +73,45 @@ namespace Prism public static void SetCursorMode(CursorMode mode) => SetCursorMode_Native(mode); public static CursorMode GetCursorMode() => GetCursorMode_Native(); - + public static bool IsGamepadConnected(int joystickID) + { + return IsGamepadConnected_Native(joystickID); + } + + public static string GetGamepadName(int joystickID) + { + return GetGamepadName_Native(joystickID); + } + + public static bool IsGamepad(int joystickID) + { + return IsGamepad_Native(joystickID); + } + + public static bool IsGamepadButtonPressed(int joystickID, GamepadButton button) + { + return IsGamepadButtonPressed_Native(joystickID, (ushort)button); + } + + public static bool IsGamepadButtonReleased(int joystickID, GamepadButton button) + { + return IsGamepadButtonReleased_Native(joystickID, (ushort)button); + } + + public static float GetGamepadAxis(int joystickID, GamepadAxis axis) + { + return GetGamepadAxis_Native(joystickID, (byte)axis); + } + + public static float GetGamepadLeftX(int joystickID) => GetGamepadLeftX_Native(joystickID); + public static float GetGamepadLeftY(int joystickID) => GetGamepadLeftY_Native(joystickID); + public static float GetGamepadRightX(int joystickID) => GetGamepadRightX_Native(joystickID); + public static float GetGamepadRightY(int joystickID) => GetGamepadRightY_Native(joystickID); + public static float GetGamepadLeftTrigger(int joystickID) => GetGamepadLeftTrigger_Native(joystickID); + public static float GetGamepadRightTrigger(int joystickID) => GetGamepadRightTrigger_Native(joystickID); + + + [MethodImpl(MethodImplOptions.InternalCall)] private static extern bool IsKeyPressed_Native(KeyCode keycode); @@ -60,5 +127,41 @@ namespace Prism [MethodImpl(MethodImplOptions.InternalCall)] private static extern CursorMode GetCursorMode_Native(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern bool IsGamepadConnected_Native(int joystickID); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern string GetGamepadName_Native(int joystickID); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern bool IsGamepad_Native(int joystickID); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern bool IsGamepadButtonPressed_Native(int joystickID, ushort button); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern bool IsGamepadButtonReleased_Native(int joystickID, ushort button); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern float GetGamepadAxis_Native(int joystickID, byte axis); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern float GetGamepadLeftX_Native(int joystickID); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern float GetGamepadLeftY_Native(int joystickID); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern float GetGamepadRightX_Native(int joystickID); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern float GetGamepadRightY_Native(int joystickID); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern float GetGamepadLeftTrigger_Native(int joystickID); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern float GetGamepadRightTrigger_Native(int joystickID); } } \ No newline at end of file diff --git a/Prism/src/Prism/Asset/AssetsManager.cpp b/Prism/src/Prism/Asset/AssetsManager.cpp index 2c1662e..4ec18c7 100644 --- a/Prism/src/Prism/Asset/AssetsManager.cpp +++ b/Prism/src/Prism/Asset/AssetsManager.cpp @@ -14,7 +14,9 @@ #include "AssetSerializer.h" #include "Prism/Core/Application.h" +#include "Prism/Core/KeyCodes.h" #include "Prism/Renderer/SceneEnvironment.h" +#include "Prism/Script/ScriptEngine.h" #include "Prism/Utilities/StringUtils.h" namespace Prism @@ -354,6 +356,7 @@ namespace Prism e.OldName = Utils::RemoveExtension(e.OldName); const AssetHandle parentHandle = FindParentHandle(e.FilePath); + bool isCharpFile = false; if (std::filesystem::path(e.FilePath).extension() != ".meta") { @@ -367,7 +370,12 @@ namespace Prism { AssetHandle assetHandle = GetAssetHandleFromFilePath(e.FilePath); if (!assetHandle) - ImportAsset(e.FilePath, parentHandle); + { + Ref asset = ImportAsset(e.FilePath, parentHandle); + if (asset->Type == AssetType::Script) + isCharpFile = true; + } + } } @@ -377,6 +385,9 @@ namespace Prism if (!e.IsDirectory) { Ref asset = ImportAsset(e.FilePath, parentHandle); + if (asset->Type == AssetType::Script) + isCharpFile = true; + } } break; @@ -407,6 +418,9 @@ namespace Prism asset->Extension = extension; AssetSerializer::UpdateMetaFile(asset); + + if (asset->Type == AssetType::Script) + isCharpFile = true; } } break; @@ -419,6 +433,9 @@ namespace Prism if (filePath != eFilePath) continue; + if (it->second->Type == AssetType::Script) + isCharpFile = true; + RemoveAsset(it->first); FileSystem::PrismDeleteFile(eFilePath + ".meta"); break; @@ -428,6 +445,10 @@ namespace Prism } } + if (isCharpFile) + { + ScriptEngine::s_ShouldCompile = true; + } if (s_AssetsChangeCallback) s_AssetsChangeCallback(); diff --git a/Prism/src/Prism/Core/Application.cpp b/Prism/src/Prism/Core/Application.cpp index a134efc..090a79c 100644 --- a/Prism/src/Prism/Core/Application.cpp +++ b/Prism/src/Prism/Core/Application.cpp @@ -27,6 +27,8 @@ namespace Prism Application::Application(const ApplicationProps& props) { + m_RootPath = std::filesystem::path(props.CommandArgs.args[0]).parent_path().generic_string(); + if (s_Instance != nullptr) { PM_CORE_ASSERT(false, "Application already exists!"); @@ -40,7 +42,7 @@ namespace Prism m_ImGuiLayer = new ImGuiLayer("ImGui Layer"); PushOverlay(m_ImGuiLayer); - ScriptEngine::Init("assets/scripts/ExampleApp.dll"); + ScriptEngine::Init("assets/scripts/Assembly-CSharp.dll"); Physics3D::Init(); AssetTypes::Init(); @@ -92,6 +94,15 @@ namespace Prism dispatcher.Dispatch(BIND_EVENT_FN(OnWindowResize)); dispatcher.Dispatch(BIND_EVENT_FN(OnWindowClose)); + // temp solve this will not be here + if (e.GetEventType() == EventType::WindowFocus) + { + m_IsFocused = true; + }else if (e.GetEventType() == EventType::WindowLostFocus) + { + m_IsFocused = false; + } + for (auto it = m_LayerStack.end(); it != m_LayerStack.begin();) { (*--it)->OnEvent(e); @@ -136,6 +147,11 @@ namespace Prism layer->OnAttach(); } + std::filesystem::path Application::GetRootPath() const + { + return m_RootPath; + } + bool Application::OnWindowResize(const WindowResizeEvent& e) { uint32_t width = e.GetWidth(), height = e.GetHeight(); diff --git a/Prism/src/Prism/Core/Application.h b/Prism/src/Prism/Core/Application.h index 61dfd25..fbfa410 100644 --- a/Prism/src/Prism/Core/Application.h +++ b/Prism/src/Prism/Core/Application.h @@ -5,6 +5,8 @@ #ifndef APPLICATION_H #define APPLICATION_H +#include + #include "LayerStack.h" #include "TimeStep.h" #include "Window.h" @@ -55,12 +57,15 @@ namespace Prism void RenderImGui(); inline Window& GetWindow() { return *m_Window; } + bool IsWindowFocused() const {return m_IsFocused;} static Application& Get(); void PushLayer(Layer* layer); void PushOverlay(Layer* layer); + std::filesystem::path GetRootPath() const; + float GetTime() const; // TODO: should impl in platform static const char* GetConfigurationName(); @@ -70,6 +75,10 @@ namespace Prism bool OnWindowClose(WindowCloseEvent& e); private: + std::filesystem::path m_RootPath; + + std::filesystem::path m_ProjectPath; + TimeStep m_TimeStep; float m_LastFrameTime = 0.0f; @@ -77,6 +86,7 @@ namespace Prism bool m_Running = true; bool m_Minimized = false; + bool m_IsFocused = false; LayerStack m_LayerStack; ImGuiLayer* m_ImGuiLayer; diff --git a/Prism/src/Prism/Core/Events/ApplicationEvent.h b/Prism/src/Prism/Core/Events/ApplicationEvent.h index 9aefc37..cab0da2 100644 --- a/Prism/src/Prism/Core/Events/ApplicationEvent.h +++ b/Prism/src/Prism/Core/Events/ApplicationEvent.h @@ -9,8 +9,8 @@ #include "Event.h" -namespace Prism { - +namespace Prism +{ class PRISM_API WindowResizeEvent : public Event { public: @@ -114,6 +114,128 @@ namespace Prism { EVENT_CLASS_TYPE(AppRender) EVENT_CLASS_CATEGORY(EventCategoryApplication) }; + + class PRISM_API GamepadConnectedEvent : public Event + { + public: + explicit GamepadConnectedEvent(int joystickID) + : m_JoystickID(joystickID) {} + + int GetJoystickID() const { return m_JoystickID; } + + std::string ToString() const override + { + std::stringstream ss; + ss << "GamepadConnectedEvent: joystick " << m_JoystickID; + return ss.str(); + } + + EVENT_CLASS_TYPE(GamepadConnected) + EVENT_CLASS_CATEGORY(EventCategoryInput | EventCategoryGamepad) + + private: + int m_JoystickID; + }; + + class PRISM_API GamepadDisconnectedEvent : public Event + { + public: + explicit GamepadDisconnectedEvent(int joystickID) + : m_JoystickID(joystickID) {} + + int GetJoystickID() const { return m_JoystickID; } + + std::string ToString() const override + { + std::stringstream ss; + ss << "GamepadDisconnectedEvent: joystick " << m_JoystickID; + return ss.str(); + } + + EVENT_CLASS_TYPE(GamepadDisconnected) + EVENT_CLASS_CATEGORY(EventCategoryInput | EventCategoryGamepad) + + private: + int m_JoystickID; + }; + + class PRISM_API GamepadButtonPressedEvent : public Event + { + public: + GamepadButtonPressedEvent(int joystickID, int button) + : m_JoystickID(joystickID), m_Button(button) {} + + int GetJoystickID() const { return m_JoystickID; } + int GetButton() const { return m_Button; } + + std::string ToString() const override + { + std::stringstream ss; + ss << "GamepadButtonPressedEvent: joystick " << m_JoystickID + << " button " << m_Button; + return ss.str(); + } + + EVENT_CLASS_TYPE(GamepadButtonPressed) + EVENT_CLASS_CATEGORY(EventCategoryInput | EventCategoryGamepadButton) + + private: + int m_JoystickID; + int m_Button; + }; + + class PRISM_API GamepadButtonReleasedEvent : public Event + { + public: + GamepadButtonReleasedEvent(int joystickID, int button) + : m_JoystickID(joystickID), m_Button(button) {} + + int GetJoystickID() const { return m_JoystickID; } + int GetButton() const { return m_Button; } + + std::string ToString() const override + { + std::stringstream ss; + ss << "GamepadButtonReleasedEvent: joystick " << m_JoystickID + << " button " << m_Button; + return ss.str(); + } + + EVENT_CLASS_TYPE(GamepadButtonReleased) + EVENT_CLASS_CATEGORY(EventCategoryInput | EventCategoryGamepadButton) + + private: + int m_JoystickID; + int m_Button; + }; + + // 可选:轴移动事件 + class PRISM_API GamepadAxisMovedEvent : public Event + { + public: + GamepadAxisMovedEvent(int joystickID, int axis, float value) + : m_JoystickID(joystickID), m_Axis(axis), m_Value(value) {} + + int GetJoystickID() const { return m_JoystickID; } + int GetAxis() const { return m_Axis; } + float GetValue() const { return m_Value; } + + std::string ToString() const override + { + std::stringstream ss; + ss << "GamepadAxisMovedEvent: joystick " << m_JoystickID + << " axis " << m_Axis << " = " << m_Value; + return ss.str(); + } + + EVENT_CLASS_TYPE(GamepadAxisMoved) + EVENT_CLASS_CATEGORY(EventCategoryInput | EventCategoryGamepad) + + private: + int m_JoystickID; + int m_Axis; + float m_Value; + }; } #endif //APPLICATIONEVENT_H diff --git a/Prism/src/Prism/Core/Events/Event.h b/Prism/src/Prism/Core/Events/Event.h index ac3477a..e0180ad 100644 --- a/Prism/src/Prism/Core/Events/Event.h +++ b/Prism/src/Prism/Core/Events/Event.h @@ -17,7 +17,12 @@ namespace Prism WindowClose, WindowResize, WindowFocus, WindowLostFocus, WindowMoved, AppTick, AppUpdate, AppRender, KeyPressed, KeyReleased, KeyTyped, - MouseButtonPressed, MouseButtonReleased, MouseMoved, MouseScrolled + MouseButtonPressed, MouseButtonReleased, MouseMoved, MouseScrolled, + + // GamePad + GamepadConnected, GamepadDisconnected, + GamepadButtonPressed, GamepadButtonReleased, + GamepadAxisMoved, }; enum EventCategory @@ -27,7 +32,11 @@ namespace Prism EventCategoryInput = BIT(1), EventCategoryKeyboard = BIT(2), EventCategoryMouse = BIT(3), - EventCategoryMouseButton = BIT(4) + EventCategoryMouseButton = BIT(4), + + // GamePadCategory + EventCategoryGamepad = BIT(5), + EventCategoryGamepadButton = BIT(6), }; #if defined(_MSC_VER) && !defined(__clang__) diff --git a/Prism/src/Prism/Core/Input.h b/Prism/src/Prism/Core/Input.h index b4f16ff..fa628a3 100644 --- a/Prism/src/Prism/Core/Input.h +++ b/Prism/src/Prism/Core/Input.h @@ -21,6 +21,21 @@ namespace Prism static void SetCursorMode(CursorMode mode); static CursorMode GetCursorMode(); + + static bool IsGamepadConnected(int joystickID); + static const char* GetGamepadName(int joystickID); + static bool IsGamepad(int joystickID); // 是否被 GLFW 映射为标准手柄 + + static bool IsGamepadButtonPressed(int joystickID, GamepadButton button); + static bool IsGamepadButtonReleased(int joystickID, GamepadButton button); + + static float GetGamepadAxis(int joystickID, GamepadAxis axis); + static float GetGamepadLeftX(int joystickID); + static float GetGamepadLeftY(int joystickID); + static float GetGamepadRightX(int joystickID); + static float GetGamepadRightY(int joystickID); + static float GetGamepadLeftTrigger(int joystickID); + static float GetGamepadRightTrigger(int joystickID); }; } diff --git a/Prism/src/Prism/Core/KeyCodes.h b/Prism/src/Prism/Core/KeyCodes.h index 9278538..f7fc10d 100644 --- a/Prism/src/Prism/Core/KeyCodes.h +++ b/Prism/src/Prism/Core/KeyCodes.h @@ -165,6 +165,37 @@ namespace Prism return os; } + typedef enum class GamepadButton : uint8_t + { + A = 0, + B = 1, + X = 2, + Y = 3, + LEFT_BUMPER = 4, + RIGHT_BUMPER = 5, + BACK = 6, + START = 7, + GUIDE = 8, + LEFT_THUMB = 9, + RIGHT_THUMB = 10, + DPAD_UP = 11, + DPAD_RIGHT = 12, + DPAD_DOWN = 13, + DPAD_LEFT = 14 + } GamepadButton; + + + typedef enum class GamepadAxis : uint8_t + { + LEFT_X = 0, + LEFT_Y = 1, + RIGHT_X = 2, + RIGHT_Y = 3, + LEFT_TRIGGER = 4, + RIGHT_TRIGGER = 5, + LAST = RIGHT_TRIGGER, + } GamepadAxis; + } // From glfw3.h @@ -295,4 +326,41 @@ namespace Prism #define PM_MOUSE_BUTTON_RIGHT 1 #define PM_MOUSE_BUTTON_MIDDLE 2 + +// GamePad +#define PM_GAMEPAD_A ::Prism::GamepadButton::A +#define PM_GAMEPAD_B ::Prism::GamepadButton::B +#define PM_GAMEPAD_X ::Prism::GamepadButton::X +#define PM_GAMEPAD_Y ::Prism::GamepadButton::Y +#define PM_GAMEPAD_LEFT_BUMPER ::Prism::GamepadButton::LEFT_BUMPER +#define PM_GAMEPAD_RIGHT_BUMPER ::Prism::GamepadButton::RIGHT_BUMPER +#define PM_GAMEPAD_BACK ::Prism::GamepadButton::BACK +#define PM_GAMEPAD_START ::Prism::GamepadButton::START +#define PM_GAMEPAD_GUIDE ::Prism::GamepadButton::GUIDE +#define PM_GAMEPAD_LEFT_THUMB ::Prism::GamepadButton::LEFT_THUMB +#define PM_GAMEPAD_RIGHT_THUMB ::Prism::GamepadButton::RIGHT_THUMB +#define PM_GAMEPAD_DPAD_UP ::Prism::GamepadButton::DPAD_UP +#define PM_GAMEPAD_DPAD_RIGHT ::Prism::GamepadButton::DPAD_RIGHT +#define PM_GAMEPAD_DPAD_DOWN ::Prism::GamepadButton::DPAD_DOWN +#define PM_GAMEPAD_DPAD_LEFT ::Prism::GamepadButton::DPAD_LEFT + +#define PM_GAMEPAD_AXIS_LEFT_X ::Prism::GamepadAxis::LEFT_X +#define PM_GAMEPAD_AXIS_LEFT_Y ::Prism::GamepadAxis::LEFT_Y +#define PM_GAMEPAD_AXIS_RIGHT_X ::Prism::GamepadAxis::RIGHT_X +#define PM_GAMEPAD_AXIS_RIGHT_Y ::Prism::GamepadAxis::RIGHT_Y +#define PM_GAMEPAD_AXIS_LEFT_TRIGGER ::Prism::GamepadAxis::LEFT_TRIGGER +#define PM_GAMEPAD_AXIS_RIGHT_TRIGGER ::Prism::GamepadAxis::RIGHT_TRIGGER +#define PM_GAMEPAD_AXIS_LAST ::Prism::GamepadAxis::LAST + +typedef enum class GamepadAxis : uint8_t +{ + LEFT_X = 0, + LEFT_Y = 1, + RIGHT_X = 2, + RIGHT_Y = 3, + LEFT_TRIGGER = 4, + RIGHT_TRIGGER = 5, + LAST = RIGHT_TRIGGER, +} GamepadAxis; + #endif //KEYCODES_H diff --git a/Prism/src/Prism/Editor/ContentBrowserPanel.cpp b/Prism/src/Prism/Editor/ContentBrowserPanel.cpp index c767a59..5cf2d06 100644 --- a/Prism/src/Prism/Editor/ContentBrowserPanel.cpp +++ b/Prism/src/Prism/Editor/ContentBrowserPanel.cpp @@ -12,6 +12,7 @@ #include "Prism/Core/Input.h" #include "Prism/Core/Log.h" #include "Prism/Renderer/Material.h" +#include "Prism/Script/ScriptEngine.h" #include "Prism/Utilities/StringUtils.h" namespace Prism @@ -241,6 +242,15 @@ namespace Prism UI::EndPropertyGrid(); } ImGui::End(); + + // temp + if (ScriptEngine::s_ShouldCompile) + { + if (Application::Get().IsWindowFocused()) + { + ScriptEngine::UpdateCSharpAssembly(); + } + } } void ContentBrowserPanel::DrawDirectoryInfo(const AssetHandle& directory) diff --git a/Prism/src/Prism/Platform/Windows/WindowsInput.cpp b/Prism/src/Prism/Platform/Windows/WindowsInput.cpp index 7413fed..e764096 100644 --- a/Prism/src/Prism/Platform/Windows/WindowsInput.cpp +++ b/Prism/src/Prism/Platform/Windows/WindowsInput.cpp @@ -59,4 +59,75 @@ namespace Prism const auto& window = dynamic_cast(Application::Get().GetWindow()); return static_cast(glfwGetInputMode(static_cast(window.GetNativeWindow()), GLFW_CURSOR) - GLFW_CURSOR_NORMAL); } + + bool Input::IsGamepadConnected(int joystickID) + { + return glfwJoystickPresent(joystickID) != 0; + } + + const char* Input::GetGamepadName(int joystickID) + { + return glfwGetJoystickName(joystickID); + } + + bool Input::IsGamepad(int joystickID) + { + return glfwJoystickIsGamepad(joystickID); + } + + bool Input::IsGamepadButtonPressed(int joystickID, GamepadButton button) + { + if (!glfwJoystickIsGamepad(joystickID)) + return false; + + GLFWgamepadstate state; + if (glfwGetGamepadState(joystickID, &state)) + { + return state.buttons[static_cast(button)] == GLFW_PRESS; + } + return false; + } + + bool Input::IsGamepadButtonReleased(int joystickID, GamepadButton button) + { + if (!glfwJoystickIsGamepad(joystickID)) + return true; + + GLFWgamepadstate state; + if (glfwGetGamepadState(joystickID, &state)) + { + return state.buttons[static_cast(button)] == GLFW_RELEASE; + } + return true; + } + + float Input::GetGamepadAxis(int joystickID, GamepadAxis axis) + { + if (!glfwJoystickIsGamepad(joystickID)) + return 0.0f; + + GLFWgamepadstate state; + if (glfwGetGamepadState(joystickID, &state)) + { + switch (axis) + { + case GamepadAxis::LEFT_X: + case GamepadAxis::LEFT_Y: + case GamepadAxis::RIGHT_X: + case GamepadAxis::RIGHT_Y: + return state.axes[static_cast(axis)]; + case GamepadAxis::LEFT_TRIGGER: + case GamepadAxis::RIGHT_TRIGGER: + return (state.axes[static_cast(axis)] + 1.0f) * 0.5f; + } + } + return 0.0f; + } + + float Input::GetGamepadLeftX(const int joystickID) { return GetGamepadAxis(joystickID, GamepadAxis::LEFT_X); } + float Input::GetGamepadLeftY(const int joystickID) { return GetGamepadAxis(joystickID, GamepadAxis::LEFT_Y); } + float Input::GetGamepadRightX(const int joystickID) { return GetGamepadAxis(joystickID, GamepadAxis::RIGHT_X); } + float Input::GetGamepadRightY(const int joystickID) { return GetGamepadAxis(joystickID, GamepadAxis::RIGHT_Y); } + float Input::GetGamepadLeftTrigger(const int joystickID) { return GetGamepadAxis(joystickID, GamepadAxis::LEFT_TRIGGER); } + float Input::GetGamepadRightTrigger(const int joystickID) { return GetGamepadAxis(joystickID, GamepadAxis::RIGHT_TRIGGER); } } diff --git a/Prism/src/Prism/Platform/Windows/WindowsWindow.cpp b/Prism/src/Prism/Platform/Windows/WindowsWindow.cpp index abbb692..1d8cd4d 100644 --- a/Prism/src/Prism/Platform/Windows/WindowsWindow.cpp +++ b/Prism/src/Prism/Platform/Windows/WindowsWindow.cpp @@ -41,6 +41,7 @@ namespace Prism void WindowsWindow::OnUpdate() { glfwPollEvents(); + PollGamepads(); glfwSwapBuffers(m_Window); const ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor(); @@ -243,5 +244,67 @@ namespace Prism { } + void WindowsWindow::PollGamepads() + { + for (int jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; ++jid) + { + bool wasConnected = m_GamepadConnected[jid]; + bool isConnected = glfwJoystickPresent(jid); + + // 连接 / 断开检测 + if (!wasConnected && isConnected) + { + GamepadConnectedEvent event(jid); + m_Data.EventCallback(event); + } + else if (wasConnected && !isConnected) + { + GamepadDisconnectedEvent event(jid); + m_Data.EventCallback(event); + } + m_GamepadConnected[jid] = isConnected; + + if (!isConnected) + continue; + + // 按钮状态 + int buttonCount; + const unsigned char* buttons = glfwGetJoystickButtons(jid, &buttonCount); + for (int i = 0; i < buttonCount && i < 32; ++i) + { + bool prev = m_GamepadButtonStates[jid][i]; + bool curr = (buttons[i] == GLFW_PRESS); + if (curr != prev) + { + if (curr) + { + GamepadButtonPressedEvent event(jid, i); + m_Data.EventCallback(event); + } + else + { + GamepadButtonReleasedEvent event(jid, i); + m_Data.EventCallback(event); + } + } + m_GamepadButtonStates[jid][i] = curr; + } + + // 轴状态(可选:仅当你想发送事件时) + int axisCount; + const float* axes = glfwGetJoystickAxes(jid, &axisCount); + for (int i = 0; i < axisCount && i < 8; ++i) + { + float prev = m_GamepadAxisStates[jid][i]; + float curr = axes[i]; + if (fabsf(curr - prev) > 0.01f) // 简单死区去抖 + { + GamepadAxisMovedEvent event(jid, i, curr); + m_Data.EventCallback(event); + } + m_GamepadAxisStates[jid][i] = curr; + } + } + } } diff --git a/Prism/src/Prism/Platform/Windows/WindowsWindow.h b/Prism/src/Prism/Platform/Windows/WindowsWindow.h index 0911b19..ffc5a55 100644 --- a/Prism/src/Prism/Platform/Windows/WindowsWindow.h +++ b/Prism/src/Prism/Platform/Windows/WindowsWindow.h @@ -40,6 +40,14 @@ namespace Prism virtual void Shutdown(); private: + // 手柄状态缓存(假设最多 16 个手柄,每个最多 32 个按钮) + bool m_GamepadConnected[16] = {false}; + bool m_GamepadButtonStates[16][32] = {{false}}; + // 记录轴值(可选,用于去重) + float m_GamepadAxisStates[16][8] = {{0.0f}}; + + void PollGamepads(); + GLFWwindow* m_Window; GLFWcursor* m_ImGuiMouseCursors[9] = { nullptr }; diff --git a/Prism/src/Prism/Renderer/Renderer3D.cpp b/Prism/src/Prism/Renderer/Renderer3D.cpp index ffa0b7e..c252a0d 100644 --- a/Prism/src/Prism/Renderer/Renderer3D.cpp +++ b/Prism/src/Prism/Renderer/Renderer3D.cpp @@ -587,7 +587,7 @@ namespace Prism const auto& directionalLights = s_Data.SceneData.SceneLightEnvironment.DirectionalLights; auto cmd = Renderer::GetCommandBuffer(); - if (!s_Data.ShadowData.ShadowEnabled || directionalLights.Intensity == 0.0f || !directionalLights.CastShadows) + if (!s_Data.ShadowData.ShadowEnabled || directionalLights.Intensity == 0.0f || !directionalLights.CastShadows) { Renderer::BeginRenderPass(s_Data.ShadowData.ShadowMapRenderPass); Renderer::EndRenderPass(); diff --git a/Prism/src/Prism/Scene/Scene.cpp b/Prism/src/Prism/Scene/Scene.cpp index 1c6282c..74e771f 100644 --- a/Prism/src/Prism/Scene/Scene.cpp +++ b/Prism/src/Prism/Scene/Scene.cpp @@ -670,17 +670,23 @@ namespace Prism // direction Light { const auto lights = m_Registry.group(entt::get); - for (const auto entity : lights) + if (!lights.empty()) { - auto [transformComponent, lightComponent] = lights.get(entity); - const glm::vec3 direction = glm::normalize(glm::mat3(transformComponent.GetTransform()) * glm::vec3(0.0f, 0.0f,1.0f)); - m_LightEnvironment.DirectionalLights = + for (const auto entity : lights) { - direction, - lightComponent.Radiance, - lightComponent.Intensity, - lightComponent.CastShadows - }; + auto [transformComponent, lightComponent] = lights.get(entity); + const glm::vec3 direction = glm::normalize(glm::mat3(transformComponent.GetTransform()) * glm::vec3(0.0f, 0.0f,1.0f)); + m_LightEnvironment.DirectionalLights = + { + direction, + lightComponent.Radiance, + lightComponent.Intensity, + lightComponent.CastShadows + }; + } + }else + { + m_LightEnvironment.DirectionalLights = {}; } } diff --git a/Prism/src/Prism/Script/ScriptEngine.cpp b/Prism/src/Prism/Script/ScriptEngine.cpp index 53e4bb8..ede1a2c 100644 --- a/Prism/src/Prism/Script/ScriptEngine.cpp +++ b/Prism/src/Prism/Script/ScriptEngine.cpp @@ -20,6 +20,7 @@ #include #include "imgui.h" +#include "Prism/Core/Application.h" #define ENABLE_MONO_DEBUG @@ -39,6 +40,10 @@ namespace Prism std::vector ScriptEngine::s_AvailableScripts; + std::vector ScriptEngine::s_ScannedScriptPaths; + bool ScriptEngine::s_ShouldCompile = true; + char ScriptEngine::s_ScanDir[256] = "assets"; + char ScriptEngine::s_OutputPath[256] = "assets/Scripts/Assembly-CSharp.dll"; #ifdef ENABLE_MONO_DEBUG static bool s_EnableMonoPDBDebug = true; @@ -796,6 +801,9 @@ namespace Prism fieldMap.emplace(name, std::move(field)); } } + + + } } @@ -885,6 +893,48 @@ namespace Prism } } + void ScriptEngine::UpdateCSharpAssembly() + { + ClearScannedScriptPaths(); + + ScanScriptFiles(s_ScanDir); + + + if (BuildScriptAssembly(s_OutputPath)) + { + LoadScriptAssembly(s_OutputPath); + + + // ===== 新增:刷新当前场景中所有脚本实体的字段映射 ===== + if (s_SceneContext) + { + UUID sceneID = s_SceneContext->GetUUID(); + if (s_EntityInstanceMap.find(sceneID) != s_EntityInstanceMap.end()) + { + auto& entityMap = s_EntityInstanceMap.at(sceneID); + for (auto& [entityID, entityInstanceData] : entityMap) + { + // 从场景中获取实体对象 + const auto& internalMap = s_SceneContext->GetEntityMap(); + auto it = internalMap.find(entityID); + if (it != internalMap.end()) + { + Entity entity = it->second; + // 重新初始化脚本字段(会保留旧字段存储值) + InitScriptEntity(entity); + } + } + } + } + // ==================================================== + + } + + RefreshAvailableScripts(); + + s_ShouldCompile = false; + } + const std::vector& ScriptEngine::GetAvailableScripts() { return s_AvailableScripts; @@ -893,6 +943,67 @@ namespace Prism void ScriptEngine::OnImGuiRender() { ImGui::Begin("Script Engine Debug"); + + ImGui::SeparatorText("Script Compiler"); + + // 扫描目录输入框 + ImGui::InputText("Scripts Dir", s_ScanDir, IM_ARRAYSIZE(s_ScanDir)); + + if (ImGui::Button("Scan .cs Files")) + { + ScriptEngine::ScanScriptFiles(s_ScanDir); + } + + ImGui::SameLine(); + if (ImGui::Button("Clear List")) + { + ScriptEngine::ClearScannedScriptPaths(); + } + + // 显示扫描结果 + const auto& scripts = ScriptEngine::GetScannedScriptPaths(); + ImGui::Text("Found %zu scripts", scripts.size()); + if (ImGui::BeginListBox("##scriptlist", ImVec2(-FLT_MIN, 100))) + { + for (const auto& path : scripts) + { + ImGui::Selectable(path.c_str()); + } + ImGui::EndListBox(); + } + + // 输出 DLL 路径 + ImGui::InputText("Output DLL", s_OutputPath, IM_ARRAYSIZE(s_OutputPath)); + + // 构建按钮 + if (ImGui::Button("Build Assembly")) + { + if (ScriptEngine::BuildScriptAssembly(s_OutputPath)) + { + PM_CORE_INFO("Build succeeded."); + } + else + { + PM_CORE_ERROR("Build failed."); + } + } + + ImGui::SameLine(); + if (ImGui::Button("Build & Load")) + { + if (ScriptEngine::BuildScriptAssembly(s_OutputPath)) + { + ScriptEngine::LoadScriptAssembly(s_OutputPath); + } + } + + // 单独加载按钮(用于已存在的 DLL) + ImGui::SameLine(); + if (ImGui::Button("Load Existing")) + { + ScriptEngine::LoadScriptAssembly(s_OutputPath); + } + for (auto& [sceneID, entityMap] : s_EntityInstanceMap) { bool opened = ImGui::TreeNode((void*)(uint64_t)sceneID, "Scene (%llx)", (uint64_t)sceneID); @@ -1018,7 +1129,7 @@ namespace Prism } } - void* PublicField::GetRuntimeValueRaw() + void* PublicField::GetRuntimeValueRaw() const { PM_CORE_ASSERT(m_EntityInstance->GetInstance()); @@ -1043,4 +1154,136 @@ namespace Prism } } + + void ScriptEngine::ScanScriptFiles(const std::string& rootDirectory) + { + s_ScannedScriptPaths.clear(); + if (!std::filesystem::exists(rootDirectory)) + { + PM_CORE_WARN("Directory does not exist: {}", rootDirectory); + return; + } + + for (const auto& entry : std::filesystem::recursive_directory_iterator(rootDirectory)) + { + if (entry.is_regular_file() && entry.path().extension() == ".cs") + { + s_ScannedScriptPaths.push_back(entry.path().string()); + } + } + PM_CORE_INFO("Found {} .cs files in {}", s_ScannedScriptPaths.size(), rootDirectory); + } + + const std::vector& ScriptEngine::GetScannedScriptPaths() + { + return s_ScannedScriptPaths; + } + + void ScriptEngine::ClearScannedScriptPaths() + { + s_ScannedScriptPaths.clear(); + } + + // 获取 mcs.exe 的路径,假设放在引擎目录下的 mono/bin 或 mono/4.5 中 + std::string ScriptEngine::GetMcsPath() + { + // 根据你的实际部署调整,这里假设 mcs.exe 与 Mono 运行时在同一目录 + // 之前你的 Mono 运行时路径为 "library/mono/4.5",mcs.exe 通常也在其中 + + const std::filesystem::path root = Application::Get().GetRootPath(); + const std::filesystem::path monoExe = root / "library/mono/bin/mono.exe"; + const std::filesystem::path mcsExe = root / "library/mono/lib/mono/4.5/mcs.exe"; + + return monoExe.generic_string() + " " + mcsExe.generic_string() + " "; + + // return (Application::Get().GetRootPath() / "library/mono/4.5/mcs.exe").generic_string(); + } + + // 生成引用参数,包含必要的系统程序集和你的核心引擎 API + std::string ScriptEngine::GetReferencesArgs() + { + const std::filesystem::path root = Application::Get().GetRootPath(); + const std::filesystem::path netstandard = root / "library/mono/lib/mono/4.5/Facades/netstandard.dll"; + const std::filesystem::path prismCore = root / "assets/scripts/Prism-ScriptCore.dll"; + + std::string refs; + refs += "-r:System.dll "; + refs += "-r:System.Core.dll "; + refs += "-r:\"" + netstandard.generic_string() + "\" "; + refs += "-r:\"" + prismCore.generic_string() + "\" "; + + return refs; + } + + // 使用 mcs 直接编译 + bool ScriptEngine::CompileWithMcs(const std::string& outputDllPath) + { + if (s_ScannedScriptPaths.empty()) + { + PM_CORE_ERROR("No script files to compile. Run ScanScriptFiles first."); + return false; + } + + // 创建输出目录 + const std::filesystem::path outPath(outputDllPath); + std::filesystem::create_directories(outPath.parent_path()); + + std::string cmd = GetMcsPath(); + cmd += "-target:library -out:\"" + outputDllPath + "\" "; + cmd += GetReferencesArgs(); + for (const auto& path : s_ScannedScriptPaths) + { + cmd += " \"" + path + "\" "; + } + + PM_CORE_INFO("Compiling with command: {}", cmd); + + // 关键:直接执行命令,就像在终端里一样 + int result = std::system(cmd.c_str()); + + // 判断是否成功:检查命令返回值,并验证 DLL 文件是否真的生成了 + bool success = (result == 0) && std::filesystem::exists(outputDllPath); + + if (!success) { + PM_CORE_ERROR("Compilation failed. Command returned: {}", result); + } + return success; + } + + // 执行命令行 + std::string ScriptEngine::ExecuteCommand(const std::string& cmd) + { + std::array buffer; + std::string result; + FILE* pipe = _popen(cmd.c_str(), "r"); + if (!pipe) + { + PM_CORE_ERROR("Failed to run command: {}", cmd); + return ""; + } + while (fgets(buffer.data(), static_cast(buffer.size()), pipe) != nullptr) + { + result += buffer.data(); + } + _pclose(pipe); + return result; + } + + bool ScriptEngine::BuildScriptAssembly(const std::string& outputDllPath) + { + return CompileWithMcs(outputDllPath); + } + + bool ScriptEngine::LoadScriptAssembly(const std::string& assemblyPath) + { + if (!std::filesystem::exists(assemblyPath)) + { + PM_CORE_ERROR("Assembly file not found: {}", assemblyPath); + return false; + } + + // 利用现有的加载函数(它会处理 AppDomain 切换等) + LoadPrismRuntimeAssembly(assemblyPath); + return true; + } } diff --git a/Prism/src/Prism/Script/ScriptEngine.h b/Prism/src/Prism/Script/ScriptEngine.h index d2e4fd4..f258364 100644 --- a/Prism/src/Prism/Script/ScriptEngine.h +++ b/Prism/src/Prism/Script/ScriptEngine.h @@ -79,7 +79,7 @@ namespace Prism void* GetStoredValueRaw() { return m_StoredValueBuffer; } void SetRuntimeValueRaw(void* src); - void* GetRuntimeValueRaw(); + void* GetRuntimeValueRaw() const; private: EntityInstance* m_EntityInstance; @@ -150,15 +150,42 @@ namespace Prism static EntityInstanceMap& GetEntityInstanceMap(); static EntityInstanceData& GetEntityInstanceData(UUID sceneID, UUID entityID); - // GetAll Script Clas s + // GetAll Script Class static const std::vector& GetAvailableScripts(); static void RefreshAvailableScripts(); + static void UpdateCSharpAssembly(); + + // 扫描指定目录下所有 .cs 文件,将路径存入内部列表 + static void ScanScriptFiles(const std::string& rootDirectory); + // 获取已扫描到的脚本路径列表 + static const std::vector& GetScannedScriptPaths(); + // 清空扫描结果 + static void ClearScannedScriptPaths(); + + // 新增:基于已扫描的文件列表构建程序集 + static bool BuildScriptAssembly(const std::string& outputDllPath); + + // 新增:加载构建好的脚本程序集 + static bool LoadScriptAssembly(const std::string& assemblyPath); + // Debug static void OnImGuiRender(); + static bool s_ShouldCompile; + + private: + static bool CompileWithMcs(const std::string& outputDllPath); + static std::string ExecuteCommand(const std::string& cmd); + static std::string GetMcsPath(); + static std::string GetReferencesArgs(); + private: static std::vector s_AvailableScripts; + + static std::vector s_ScannedScriptPaths; + static char s_ScanDir[256]; + static char s_OutputPath[256] ; }; } diff --git a/Prism/src/Prism/Script/ScriptEngineRegistry.cpp b/Prism/src/Prism/Script/ScriptEngineRegistry.cpp index 2d3b3fb..8117b47 100644 --- a/Prism/src/Prism/Script/ScriptEngineRegistry.cpp +++ b/Prism/src/Prism/Script/ScriptEngineRegistry.cpp @@ -107,6 +107,24 @@ namespace Prism mono_add_internal_call("Prism.Input::SetCursorMode_Native", (const void*)Prism::Script::Prism_Input_SetCursorMode); mono_add_internal_call("Prism.Input::GetCursorMode_Native", (const void*)Prism::Script::Prism_Input_GetCursorMode); + // 手柄连接 + mono_add_internal_call("Prism.Input::IsGamepadConnected_Native", (const void*)Prism::Script::Prism_Input_IsGamepadConnected); + mono_add_internal_call("Prism.Input::GetGamepadName_Native", (const void*)Prism::Script::Prism_Input_GetGamepadName); + mono_add_internal_call("Prism.Input::IsGamepad_Native", (const void*)Prism::Script::Prism_Input_IsGamepad); + + // 按钮 + mono_add_internal_call("Prism.Input::IsGamepadButtonPressed_Native", (const void*)Prism::Script::Prism_Input_IsGamepadButtonPressed); + mono_add_internal_call("Prism.Input::IsGamepadButtonReleased_Native", (const void*)Prism::Script::Prism_Input_IsGamepadButtonReleased); + + // 轴 + mono_add_internal_call("Prism.Input::GetGamepadAxis_Native", (const void*)Prism::Script::Prism_Input_GetGamepadAxis); + mono_add_internal_call("Prism.Input::GetGamepadLeftX_Native", (const void*)Prism::Script::Prism_Input_GetGamepadLeftX); + mono_add_internal_call("Prism.Input::GetGamepadLeftY_Native", (const void*)Prism::Script::Prism_Input_GetGamepadLeftY); + mono_add_internal_call("Prism.Input::GetGamepadRightX_Native", (const void*)Prism::Script::Prism_Input_GetGamepadRightX); + mono_add_internal_call("Prism.Input::GetGamepadRightY_Native", (const void*)Prism::Script::Prism_Input_GetGamepadRightY); + mono_add_internal_call("Prism.Input::GetGamepadLeftTrigger_Native", (const void*)Prism::Script::Prism_Input_GetGamepadLeftTrigger); + mono_add_internal_call("Prism.Input::GetGamepadRightTrigger_Native", (const void*)Prism::Script::Prism_Input_GetGamepadRightTrigger); + // 2D Physic mono_add_internal_call("Prism.RigidBody2DComponent::ApplyLinearImpulse_Native", (const void*)Prism::Script::Prism_RigidBody2DComponent_ApplyLinearImpulse); mono_add_internal_call("Prism.RigidBody2DComponent::GetLinearVelocity_Native", (const void *)Prism::Script::Prism_RigidBody2DComponent_GetLinearVelocity); diff --git a/Prism/src/Prism/Script/ScriptWrappers.cpp b/Prism/src/Prism/Script/ScriptWrappers.cpp index fefd67c..7bda330 100644 --- a/Prism/src/Prism/Script/ScriptWrappers.cpp +++ b/Prism/src/Prism/Script/ScriptWrappers.cpp @@ -99,6 +99,68 @@ namespace Prism { namespace Script { return Input::GetCursorMode(); } + bool Prism_Input_IsGamepadConnected(int joystickID) + { + return Input::IsGamepadConnected(joystickID); + } + + // 获取手柄名称(返回 MonoString) + MonoString* Prism_Input_GetGamepadName(int joystickID) + { + const char* name = Input::GetGamepadName(joystickID); + return mono_string_new(mono_domain_get(), name); + } + + bool Prism_Input_IsGamepad(int joystickID) + { + return Input::IsGamepad(joystickID); + } + + bool Prism_Input_IsGamepadButtonPressed(int joystickID, uint32_t button) + { + return Input::IsGamepadButtonPressed(joystickID, static_cast(button)); + } + + bool Prism_Input_IsGamepadButtonReleased(int joystickID, uint32_t button) + { + return Input::IsGamepadButtonReleased(joystickID, static_cast(button)); + } + + float Prism_Input_GetGamepadAxis(int joystickID, uint32_t axis) + { + return Input::GetGamepadAxis(joystickID, static_cast(axis)); + } + + float Prism_Input_GetGamepadLeftX(int joystickID) + { + return Input::GetGamepadLeftX(joystickID); + } + + float Prism_Input_GetGamepadLeftY(int joystickID) + { + return Input::GetGamepadLeftY(joystickID); + } + + float Prism_Input_GetGamepadRightX(int joystickID) + { + return Input::GetGamepadRightX(joystickID); + } + + float Prism_Input_GetGamepadRightY(int joystickID) + { + return Input::GetGamepadRightY(joystickID); + } + + float Prism_Input_GetGamepadLeftTrigger(int joystickID) + { + return Input::GetGamepadLeftTrigger(joystickID); + } + + float Prism_Input_GetGamepadRightTrigger(int joystickID) + { + return Input::GetGamepadRightTrigger(joystickID); + } + bool Prism_Physics_Raycast(const glm::vec3* origin, const glm::vec3* direction, const float maxDistance, RaycastHit* hit) { return PhysicsWrappers::Raycast(*origin, *direction, maxDistance, hit); diff --git a/Prism/src/Prism/Script/ScriptWrappers.h b/Prism/src/Prism/Script/ScriptWrappers.h index deae5a5..d7fdee6 100644 --- a/Prism/src/Prism/Script/ScriptWrappers.h +++ b/Prism/src/Prism/Script/ScriptWrappers.h @@ -43,6 +43,20 @@ namespace Prism::Script void Prism_Input_SetCursorMode(CursorMode mode); CursorMode Prism_Input_GetCursorMode(); + bool Prism_Input_IsGamepadConnected(int joystickID); + MonoString* Prism_Input_GetGamepadName(int joystickID); + bool Prism_Input_IsGamepad(int joystickID); + bool Prism_Input_IsGamepadButtonPressed(int joystickID, uint32_t button); + bool Prism_Input_IsGamepadButtonReleased(int joystickID, uint32_t button); + float Prism_Input_GetGamepadAxis(int joystickID, uint32_t axis); + float Prism_Input_GetGamepadLeftX(int joystickID); + float Prism_Input_GetGamepadLeftY(int joystickID); + float Prism_Input_GetGamepadRightX(int joystickID); + float Prism_Input_GetGamepadRightY(int joystickID); + float Prism_Input_GetGamepadLeftTrigger(int joystickID); + float Prism_Input_GetGamepadRightTrigger(int joystickID); + + // Physics bool Prism_Physics_Raycast(const glm::vec3* origin, const glm::vec3* direction, float maxDistance, RaycastHit* hit); MonoArray* Prism_Physics_OverlapBox(const glm::vec3* origin, const glm::vec3* halfSize);