dont draw gizmos on play
This commit is contained in:
parent
7c7589ce8e
commit
3402992189
|
@ -40,6 +40,7 @@ namespace SHADE
|
|||
shouldUpdateCamera = false;
|
||||
}
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
|
||||
SHEditor* editor = SHSystemManager::GetSystem<SHEditor>();
|
||||
|
||||
if (Begin())
|
||||
{
|
||||
|
@ -51,7 +52,6 @@ namespace SHADE
|
|||
beginCursorPos = ImGui::GetCursorScreenPos();
|
||||
viewportMousePos = { mousePos.x - beginCursorPos.x, mousePos.y - beginCursorPos.y };
|
||||
gfxSystem->GetMousePickSystem()->SetViewportMousePos(viewportMousePos);
|
||||
|
||||
ImGui::Image((ImTextureID)descriptorSet, { beginContentRegionAvailable.x, beginContentRegionAvailable.y });
|
||||
|
||||
if (ImGui::IsWindowHovered() && ImGui::IsMouseDown(ImGuiMouseButton_Right))
|
||||
|
@ -64,23 +64,24 @@ namespace SHADE
|
|||
|
||||
shouldUpdateCamera = true;
|
||||
}
|
||||
if (ImGui::IsWindowFocused() && !ImGui::IsMouseDown(ImGuiMouseButton_Right))
|
||||
if (editor->editorState != SHEditor::State::PLAY && ImGui::IsWindowFocused() && !ImGui::IsMouseDown(ImGuiMouseButton_Right))
|
||||
{
|
||||
if (ImGui::IsKeyReleased(ImGuiKey_Q))
|
||||
if (ImGui::IsKeyReleased(ImGuiKey_W))
|
||||
{
|
||||
transformGizmo.operation = SHTransformGizmo::Operation::TRANSLATE;
|
||||
}
|
||||
if (ImGui::IsKeyReleased(ImGuiKey_W))
|
||||
if (ImGui::IsKeyReleased(ImGuiKey_E))
|
||||
{
|
||||
transformGizmo.operation = SHTransformGizmo::Operation::ROTATE;
|
||||
}
|
||||
if (ImGui::IsKeyReleased(ImGuiKey_E))
|
||||
if (ImGui::IsKeyReleased(ImGuiKey_R))
|
||||
{
|
||||
transformGizmo.operation = SHTransformGizmo::Operation::SCALE;
|
||||
}
|
||||
}
|
||||
}
|
||||
ImGuizmo::SetRect(beginCursorPos.x, beginCursorPos.y, beginContentRegionAvailable.x, beginContentRegionAvailable.y);
|
||||
if(editor->editorState != SHEditor::State::PLAY)
|
||||
transformGizmo.Draw();
|
||||
ImGui::End();
|
||||
ImGui::PopStyleVar();
|
||||
|
|
Loading…
Reference in New Issue