From b5d77ea36394020cd53b85e4899fbd2c48539817 Mon Sep 17 00:00:00 2001 From: wsh Date: Wed, 28 May 2025 20:04:36 +0900 Subject: [PATCH] 1 --- Assets/Scenes/pre-0.24.0.unity | 100 +++++++++++++++++- .../GizmoCommand/ActivateMoveGizmoCommand.cs | 1 + .../ActivateRotateGizmoCommand.cs | 7 +- .../GizmoCommand/ActivateScaleGizmoCommand.cs | 1 + .../Scripts/Studio/UI/Canvas/Canvas_Popup.cs | 2 +- .../Scripts/Studio/UI/Canvas/Canvas_Static.cs | 1 - .../Scripts/Studio/UI/Panel/Panel_Toolbar.cs | 45 ++++++-- 7 files changed, 136 insertions(+), 21 deletions(-) diff --git a/Assets/Scenes/pre-0.24.0.unity b/Assets/Scenes/pre-0.24.0.unity index 97936f42..831012cc 100644 --- a/Assets/Scenes/pre-0.24.0.unity +++ b/Assets/Scenes/pre-0.24.0.unity @@ -2447,6 +2447,10 @@ PrefabInstance: propertyPath: m_Name value: Panel_SceneTab objectReference: {fileID: 0} + - target: {fileID: 7357093652319228238, guid: d052112ad62360e4ba550f9f5fa8d61e, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 7869535843565774663, guid: d052112ad62360e4ba550f9f5fa8d61e, type: 3} propertyPath: m_SizeDelta.x value: 0 @@ -2624,6 +2628,7 @@ RectTransform: m_LocalScale: {x: 0, y: 0, z: 0} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 929951560} - {fileID: 663673411} - {fileID: 235881574} - {fileID: 434723664} @@ -2661,7 +2666,6 @@ RectTransform: - {fileID: 802579212} - {fileID: 1970313509} - {fileID: 1276837142} - - {fileID: 929951560} m_Father: {fileID: 1981809316} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -2716,6 +2720,7 @@ MonoBehaviour: panel_saveandopenchecker: {fileID: 0} panel_datarepository: {fileID: 0} panel_agv: {fileID: 0} + panel_toolbar: {fileID: 0} panel_dataconnectmodal: {fileID: 0} panel_alarmconnectmodal: {fileID: 0} --- !u!114 &545811783 @@ -4345,10 +4350,102 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3436268807860288270, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3436268807860288270, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3436268807860288270, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3436268807860288270, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4678595536376548550, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4678595536376548550, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4678595536376548550, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4678595536376548550, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6035057118420408689, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6035057118420408689, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6035057118420408689, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6035057118420408689, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 6865732664778449082, guid: a1beeb762c585d645829350a5fa6025d, type: 3} propertyPath: m_Name value: Panel_Toolbar objectReference: {fileID: 0} + - target: {fileID: 6865732664778449082, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8269507675293814561, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8269507675293814561, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: tooltipText + value: "\uBC14\uB2E5\uC120 \uD65C\uC131\uD654 \uD1A0\uAE00" + objectReference: {fileID: 0} + - target: {fileID: 8596069817915449302, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8596069817915449302, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8596069817915449302, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8596069817915449302, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8934699204040479535, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8934699204040479535, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8934699204040479535, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8934699204040479535, guid: a1beeb762c585d645829350a5fa6025d, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -12994,7 +13091,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: panel_studiotopbar: {fileID: 0} - panel_toolbar: {fileID: 0} panel_scenetab: {fileID: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: diff --git a/Assets/Scripts/Studio/Command/GizmoCommand/ActivateMoveGizmoCommand.cs b/Assets/Scripts/Studio/Command/GizmoCommand/ActivateMoveGizmoCommand.cs index 2f8733ea..a8beddb2 100644 --- a/Assets/Scripts/Studio/Command/GizmoCommand/ActivateMoveGizmoCommand.cs +++ b/Assets/Scripts/Studio/Command/GizmoCommand/ActivateMoveGizmoCommand.cs @@ -23,6 +23,7 @@ namespace Studio.Command { var renderObjectHandler = ManagerHub.instance.Get(); renderObjectHandler.rtgController.SetWorkGizmoId(RTGController.GizmoId.Move); + CanvasManager.instance.GetCanvas().panel_toolbar.SetActionToggle(UI.ObjectGizmo.Move, true); } } } diff --git a/Assets/Scripts/Studio/Command/GizmoCommand/ActivateRotateGizmoCommand.cs b/Assets/Scripts/Studio/Command/GizmoCommand/ActivateRotateGizmoCommand.cs index 31983926..ca6b91f7 100644 --- a/Assets/Scripts/Studio/Command/GizmoCommand/ActivateRotateGizmoCommand.cs +++ b/Assets/Scripts/Studio/Command/GizmoCommand/ActivateRotateGizmoCommand.cs @@ -1,17 +1,11 @@ using Studio.AssetTool; using Studio.Manage; using Studio.RuntimeGizmo; -using Studio.Util; namespace Studio.Command { public class ActivateRotateGizmoCommand : IIrreversibleCommand { - public ActivateRotateGizmoCommand() - { - - } - public string id { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } public bool CanExecute() @@ -23,6 +17,7 @@ namespace Studio.Command { var renderObjectHandler = ManagerHub.instance.Get(); renderObjectHandler.rtgController.SetWorkGizmoId(RTGController.GizmoId.Rotate); + CanvasManager.instance.GetCanvas().panel_toolbar.SetActionToggle(UI.ObjectGizmo.Rotate, true); } } } diff --git a/Assets/Scripts/Studio/Command/GizmoCommand/ActivateScaleGizmoCommand.cs b/Assets/Scripts/Studio/Command/GizmoCommand/ActivateScaleGizmoCommand.cs index b49fb0d5..f1fb9d59 100644 --- a/Assets/Scripts/Studio/Command/GizmoCommand/ActivateScaleGizmoCommand.cs +++ b/Assets/Scripts/Studio/Command/GizmoCommand/ActivateScaleGizmoCommand.cs @@ -23,6 +23,7 @@ namespace Studio.Command { var renderObjectHandler = ManagerHub.instance.Get(); renderObjectHandler.rtgController.SetWorkGizmoId(RTGController.GizmoId.Scale); + CanvasManager.instance.GetCanvas().panel_toolbar.SetActionToggle(UI.ObjectGizmo.Scale, true); } } } diff --git a/Assets/Scripts/Studio/UI/Canvas/Canvas_Popup.cs b/Assets/Scripts/Studio/UI/Canvas/Canvas_Popup.cs index 41c79acf..efc74811 100644 --- a/Assets/Scripts/Studio/UI/Canvas/Canvas_Popup.cs +++ b/Assets/Scripts/Studio/UI/Canvas/Canvas_Popup.cs @@ -48,7 +48,7 @@ namespace Studio public Panel_SaveAndOpenChecker panel_saveandopenchecker; public Panel_DataRepository panel_datarepository; public Panel_AGV panel_agv; - + public Panel_Toolbar panel_toolbar; public Panel_DataConnectModal panel_dataconnectmodal; public Panel_AlarmConnectModal panel_alarmconnectmodal; internal Panel_MQTTTestResult panel_mqtttestresult; diff --git a/Assets/Scripts/Studio/UI/Canvas/Canvas_Static.cs b/Assets/Scripts/Studio/UI/Canvas/Canvas_Static.cs index bb84223c..f1d04ea2 100644 --- a/Assets/Scripts/Studio/UI/Canvas/Canvas_Static.cs +++ b/Assets/Scripts/Studio/UI/Canvas/Canvas_Static.cs @@ -12,7 +12,6 @@ namespace Studio.UI public class Canvas_Static : CanvasBase { public Panel_StudioTopBar panel_studiotopbar; - public Panel_Toolbar panel_toolbar; public Panel_SceneTab panel_scenetab; private void Awake() diff --git a/Assets/Scripts/Studio/UI/Panel/Panel_Toolbar.cs b/Assets/Scripts/Studio/UI/Panel/Panel_Toolbar.cs index 2e8dffce..dd00ef28 100644 --- a/Assets/Scripts/Studio/UI/Panel/Panel_Toolbar.cs +++ b/Assets/Scripts/Studio/UI/Panel/Panel_Toolbar.cs @@ -1,10 +1,19 @@ +using RTG; using Studio.Command; using System; +using UnityEditor; using UnityEngine.UI; using XRLib.UI; namespace Studio.UI { + public enum ObjectGizmo + { + None, + Move, + Rotate, + Scale, + } public class Panel_Toolbar : PanelBase { private ToggleGroup TabToggles; @@ -48,44 +57,58 @@ namespace Studio.UI private void OnClickGrid(bool isOn) { - SetToggleChanged(Button_Grid, isOn); onClickGrid?.Invoke(); + SetToggleChanged(Button_Grid, isOn); } + void GizmoToggleOff() + { + SetToggleChanged(Button_Move, false); + SetToggleChanged(Button_Expand, false); + SetToggleChanged(Button_Rotate, false); + } + public void SetActionToggle(ObjectGizmo gizmo, bool isOn) + { + GizmoToggleOff(); + switch (gizmo) + { + case ObjectGizmo.Move: + SetToggleChanged(Button_Move, isOn); + break; + case ObjectGizmo.Rotate: + SetToggleChanged(Button_Rotate, isOn); + break; + case ObjectGizmo.Scale: + SetToggleChanged(Button_Expand, isOn); + break; + default: + break; + } + } private void OnClickMove(bool isOn) { CommandInvoker.instance.Invoke(new ActivateMoveGizmoCommand()); - SetToggleChanged(Button_Move, isOn); - onClickMove?.Invoke(); } private void OnClickExpand(bool isOn) { CommandInvoker.instance.Invoke(new ActivateScaleGizmoCommand()); - SetToggleChanged(Button_Expand, isOn); - onClickExpand?.Invoke(); } private void OnClickRotate(bool isOn) { CommandInvoker.instance.Invoke(new ActivateRotateGizmoCommand()); - SetToggleChanged(Button_Rotate, isOn); - onClickRotate?.Invoke(); } private void OnClickRemove(bool isOn) { CommandInvoker.instance.Invoke(new RemoveSelectObjectCommand()); - SetToggleChanged(Button_Remove, isOn); - onClickRemove?.Invoke(); } private void OnClickCopy(bool isOn) { CommandInvoker.instance.Invoke(new CopyObjectCommand()); - SetToggleChanged(Button_Copy, isOn); - onClickCopy?.Invoke(); } } }