마우스 우클릭 상태일 시 Gizmo 변경 제한 #149

Merged
UVCXR merged 2 commits from jym/250609_04 into main 2025-06-09 18:30:09 +09:00

View File

@@ -29,6 +29,7 @@ namespace Studio.AssetTool
int uiLayer;
int selectIndex;
bool lockHandler = false;
bool inputLockhandler = false;
public override void Init()
{
@@ -413,10 +414,12 @@ namespace Studio.AssetTool
downKeyActions.Add(KeyCode.Mouse0, OnMousePointerDown);
upKeyActions.Add(KeyCode.Mouse0, OnMousePointerUp);
downKeyActions.Add(KeyCode.Q, () => CommandInvoker.instance.Invoke(new ActivateMoveGizmoCommand()));
downKeyActions.Add(KeyCode.W, () => CommandInvoker.instance.Invoke(new ActivateRotateGizmoCommand()));
downKeyActions.Add(KeyCode.E, () => CommandInvoker.instance.Invoke(new ActivateScaleGizmoCommand()));
downKeyActions.Add(KeyCode.R, () => CommandInvoker.instance.Invoke(new ResetGizmoCommand()));
downKeyActions.Add(KeyCode.Mouse1, OnMouseRightPointerDown);
upKeyActions.Add(KeyCode.Mouse1, OnMouseRightPointerUp);
downKeyActions.Add(KeyCode.Q, () => SetGizmoChangedCommand(new ActivateMoveGizmoCommand()));
downKeyActions.Add(KeyCode.W, () => SetGizmoChangedCommand(new ActivateRotateGizmoCommand()));
downKeyActions.Add(KeyCode.E, () => SetGizmoChangedCommand(new ActivateScaleGizmoCommand()));
downKeyActions.Add(KeyCode.R, () => SetGizmoChangedCommand(new ResetGizmoCommand()));
downKeyActions.Add(KeyCode.Delete, () => CommandInvoker.instance.Invoke(new RemoveSelectObjectCommand()));
getKeyActions.Add(KeyCode.V, VertexSnap);
@@ -436,5 +439,20 @@ namespace Studio.AssetTool
var handler = new InputHandler(getKeyActions, downKeyActions, upKeyActions, shortcutTable);
return handler;
}
private void OnMouseRightPointerDown()
{
inputLockhandler = true;
}
private void OnMouseRightPointerUp()
{
inputLockhandler = false;
}
private void SetGizmoChangedCommand(IIrreversibleCommand command)
{
if (!inputLockhandler)
{
CommandInvoker.instance.Invoke(command);
}
}
}
}