7. RenderObjectHandler의 GizmoAction KeyInput 타이밍 수정 (get->down)

8. RenderObjectHandler에 RemoveSelectObjectCommand 액션 추가
This commit is contained in:
wsh
2025-05-22 17:10:46 +09:00
parent 2d3616b9ee
commit d3ce3bcaaf
5 changed files with 276 additions and 44 deletions

View File

@@ -1368,6 +1368,7 @@ RectTransform:
- {fileID: 4062748835041242030}
- {fileID: 7669971977167462851}
- {fileID: 14884185527709109}
- {fileID: 6055411565447103197}
m_Father: {fileID: 1573249193208025711}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
@@ -1562,6 +1563,55 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &3905796311297402294
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6055411565447103197}
- component: {fileID: 5228486192989051087}
m_Layer: 5
m_Name: PopupScrollViewItem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6055411565447103197
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3905796311297402294}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8396160395029261019}
m_Father: {fileID: 3774859264702987967}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 327, y: -11.646606}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &5228486192989051087
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3905796311297402294}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 35320badd37a474489e786554cde8813, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &4244143198177438994
GameObject:
m_ObjectHideFlags: 0
@@ -1652,6 +1702,82 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
--- !u!1 &4257137996181769062
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8396160395029261019}
- component: {fileID: 7405042080931199372}
- component: {fileID: 2403408689949033338}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8396160395029261019
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4257137996181769062}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 514978056142714461}
m_Father: {fileID: 6055411565447103197}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 95, y: 0}
m_SizeDelta: {x: 150, y: 24}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7405042080931199372
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4257137996181769062}
m_CullTransparentMesh: 1
--- !u!114 &2403408689949033338
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4257137996181769062}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0.9094448, b: 0, a: 0.19607843}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &4319735508156098280
GameObject:
m_ObjectHideFlags: 0
@@ -1865,6 +1991,142 @@ MonoBehaviour:
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &5165986710654382505
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 514978056142714461}
- component: {fileID: 743505372548182760}
- component: {fileID: 6364859798121328650}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &514978056142714461
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5165986710654382505}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8396160395029261019}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -20, y: 24}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &743505372548182760
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5165986710654382505}
m_CullTransparentMesh: 1
--- !u!114 &6364859798121328650
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5165986710654382505}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: New Text
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 2516582400
m_fontColor: {r: 0, g: 0, b: 0, a: 0.5882353}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 15
m_fontSizeBase: 15
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &5730464145202627090
GameObject:
m_ObjectHideFlags: 0

View File

@@ -394,10 +394,7 @@ namespace Studio.AssetTool
userInputManager .RemoveHandler(myHandler);
}
class RenderObjectHandlerInputHandler : InputHandler
{
}
public InputHandler GetInputHandler()
{
var getKeyActions = new Dictionary<KeyCode, Action>();
@@ -406,10 +403,11 @@ namespace Studio.AssetTool
downKeyActions.Add(KeyCode.Mouse0, OnMousePointerDown);
upKeyActions.Add(KeyCode.Mouse0, OnMousePointerUp);
getKeyActions.Add(KeyCode.Q, () => CommandInvoker.instance.Invoke(new ActivateMoveGizmoCommand()));
getKeyActions.Add(KeyCode.W, () => CommandInvoker.instance.Invoke(new ActivateRotateGizmoCommand()));
getKeyActions.Add(KeyCode.E, () => CommandInvoker.instance.Invoke(new ActivateScaleGizmoCommand()));
getKeyActions.Add(KeyCode.R, () => CommandInvoker.instance.Invoke(new ResetGizmoCommand()));
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.Delete, () => CommandInvoker.instance.Invoke(new RemoveSelectObjectCommand()));
getKeyActions.Add(KeyCode.V, VertexSnap);
var shortcutTable = new Dictionary<KeyCode, Dictionary<KeyCode, Action>>();

View File

@@ -21,11 +21,12 @@ namespace Studio.Command
public void Execute()
{
var renderObjectHandler = ManagerHub.instance.Get<RenderObjectHandler>();
var connector = ManagerHub.instance.Get<CustomAssetConnector>();
if (renderObjectHandler.selectedRenderObjects.Count == 0)
return;
var connector = ManagerHub.instance.Get<CustomAssetConnector>();
for (int i = 0; i < renderObjectHandler.selectedRenderObjects.Count; i++)
{
ConnectedAsset searchAsset = connector.connectedAssets.Find((x) => x.renderObject == renderObjectHandler.selectedRenderObjects[i]);

View File

@@ -29,14 +29,8 @@ namespace Studio.UI
statusPanel.SetMode(ModePanel.ProgramMode.ObjectLayout);
panel_toolbar.onClickMove += () => CommandInvoker.instance.Invoke(new ActivateMoveGizmoCommand());
panel_toolbar.onClickExpand += () => CommandInvoker.instance.Invoke(new ActivateScaleGizmoCommand());
panel_toolbar.onClickRotate += () => CommandInvoker.instance.Invoke(new ActivateRotateGizmoCommand());
panel_toolbar.onClickRemove += () => CommandInvoker.instance.Invoke(new RemoveSelectObjectCommand());
panel_toolbar.onClickCopy += () => CommandInvoker.instance.Invoke(new CopyObjectCommand());
panel_studiotopbar.onClickAssetLibraryWindow += fbxFileManager.LoadLocalData;
}
}
}

View File

@@ -1,7 +1,7 @@
using Studio.Command;
using System;
using UnityEngine.UI;
using XRLib.UI;
using static Studio.Enums;
namespace Studio.UI
{
@@ -32,10 +32,6 @@ namespace Studio.UI
public event Action onClickMeasurementMode;
public event Action onClickUnit;
public event Action onClickAGVMode;
public event Action onClickStartDrawWall;
public event Action<BuilderState> onClickModifyWall;
public event Action<BuilderState> onClickRemoveWall;
public event Action<BuilderState> onClickEndWall;
public override void AfterAwake()
{
Button_Grid.onClick.AddListener(OnClickGrid);
@@ -48,30 +44,6 @@ namespace Studio.UI
Button_MeasurementMode.onClick.AddListener(OnClickMeasurementMode);
Button_Unit.onClick.AddListener(OnClickUnit);
Button_AGVMode.onClick.AddListener(OnClickAGVMode);
//Button_StartDrawWall.onClick.AddListener(OnClickStartWall);
//Button_ModifyWall.onClick.AddListener(OnClickModifyWall);
//Button_RemoveWall.onClick.AddListener(OnClickRemoveWall);
//Button_EndDrawWall.onClick.AddListener(OnClicEndDrawWall);
}
private void OnClickRemoveWall()
{
onClickRemoveWall?.Invoke(BuilderState.PointRemove);
}
private void OnClickModifyWall()
{
onClickModifyWall?.Invoke(BuilderState.PointModfiy);
}
private void OnClickStartWall()
{
onClickStartDrawWall?.Invoke();
}
private void OnClicEndDrawWall()
{
onClickEndWall?.Invoke(BuilderState.None);
}
private void OnClickGrid()
@@ -86,26 +58,31 @@ namespace Studio.UI
private void OnClickMove()
{
CommandInvoker.instance.Invoke(new ActivateMoveGizmoCommand());
onClickMove?.Invoke();
}
private void OnClickExpand()
{
CommandInvoker.instance.Invoke(new ActivateScaleGizmoCommand());
onClickExpand?.Invoke();
}
private void OnClickRotate()
{
CommandInvoker.instance.Invoke(new ActivateRotateGizmoCommand());
onClickRotate?.Invoke();
}
private void OnClickRemove()
{
CommandInvoker.instance.Invoke(new RemoveSelectObjectCommand());
onClickRemove?.Invoke();
}
private void OnClickCopy()
{
CommandInvoker.instance.Invoke(new CopyObjectCommand());
onClickCopy?.Invoke();
}