diff --git a/Assets/Scripts/ExternalAssets/Gizmo/RTGController.cs b/Assets/Scripts/ExternalAssets/Gizmo/RTGController.cs index 8a24a0b7..326c2401 100644 --- a/Assets/Scripts/ExternalAssets/Gizmo/RTGController.cs +++ b/Assets/Scripts/ExternalAssets/Gizmo/RTGController.cs @@ -61,7 +61,9 @@ namespace Studio.RuntimeGizmo workGizmoId = GizmoId.None; } public void SetWorkGizmoId(GizmoId gizmoId) - { + { + if (ManagerHub.instance.Get().curState == RunManager.EState.Run) + return; objectMoveGizmo.Gizmo.SetEnabled(false); objectRotationGizmo.Gizmo.SetEnabled(false); objectScaleGizmo.Gizmo.SetEnabled(false); @@ -102,6 +104,8 @@ namespace Studio.RuntimeGizmo } public void SetGizmoTargetObjects(List objects) { + if (ManagerHub.instance.Get().curState == RunManager.EState.Run) + return; selectedObjects.Clear(); selectedObjects.AddRange(objects); objectMoveGizmo.SetTargetObjects(selectedObjects); @@ -111,6 +115,10 @@ namespace Studio.RuntimeGizmo workGizmo.Gizmo.SetEnabled(selectedObjects.Count != 0); } + public void ResetGizmo() + { + SetGizmoTargetObjects(new List()); + } private void OnGizmoDragBegin(Gizmo gizmo, int t) { onTransformBegin?.Invoke(); diff --git a/Assets/Scripts/Studio/AssetTool/CustomAssetConnector.cs b/Assets/Scripts/Studio/AssetTool/CustomAssetConnector.cs index 2c4ff32c..d2e294ee 100644 --- a/Assets/Scripts/Studio/AssetTool/CustomAssetConnector.cs +++ b/Assets/Scripts/Studio/AssetTool/CustomAssetConnector.cs @@ -125,7 +125,6 @@ namespace Studio.AssetTool public GameObject CreateAsset(string name) { AssetLibraryItem item = assetScrollView.FindItem(name, AssetLibraryItemType.file); - OnAssetSelected(item); GameObject obj = selectRenderObject.gameObject; OnAssetDropped(item); @@ -283,7 +282,7 @@ namespace Studio.AssetTool } internal void OnSelectObjects(string name, List selectedObjects) { - if (selectedObjects.Count == 0) + if (selectedObjects.Count == 0) return; var canvas_Popup = CanvasManager.instance.GetCanvas(); if (ManagerHub.instance.Get().curState == RunManager.EState.Run) diff --git a/Assets/Scripts/Studio/AssetTool/RenderObjectHandler.cs b/Assets/Scripts/Studio/AssetTool/RenderObjectHandler.cs index 0fbd5cfa..adc9180f 100644 --- a/Assets/Scripts/Studio/AssetTool/RenderObjectHandler.cs +++ b/Assets/Scripts/Studio/AssetTool/RenderObjectHandler.cs @@ -141,7 +141,6 @@ namespace Studio.AssetTool CommandInvoker.instance.Invoke(new ResetGizmoCommand()); DeselectAll(); } - CanvasManager.instance.GetCanvas().panel_draghandler.ForceEndDrag(); } public void DeselectAll() @@ -429,7 +428,7 @@ namespace Studio.AssetTool #else shortcutTable.Add(KeyCode.LeftControl, new Dictionary()); shortcutTable[KeyCode.LeftControl].Add(KeyCode.C, SaveItemsToCopy); - shortcutTable[KeyCode.LeftShift].Add(KeyCode.V, () => CommandInvoker.instance.Invoke(new CopyObjectCommand())); + shortcutTable[KeyCode.LeftControl].Add(KeyCode.V, () => CommandInvoker.instance.Invoke(new CopyObjectCommand())); #endif var handler = new InputHandler(getKeyActions, downKeyActions, upKeyActions, shortcutTable); diff --git a/Assets/Scripts/Studio/Managers/RunManager.cs b/Assets/Scripts/Studio/Managers/RunManager.cs index 5adc632d..23a283c4 100644 --- a/Assets/Scripts/Studio/Managers/RunManager.cs +++ b/Assets/Scripts/Studio/Managers/RunManager.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +using NUnit.Framework; +using Studio.AssetTool; using Studio.Conifg; using Studio.Manage; using Studio.Util; @@ -28,8 +29,10 @@ namespace Studio.Manage public void ChangeState() { + ManagerHub.instance.Get().rtgController.ResetGizmo(); + ManagerHub.instance.Get().OnDeselectAll(); + curState = curState == EState.Stop ? EState.Run : EState.Stop; - Debug.Log("curState " + curState); switch (curState) { case EState.Run: diff --git a/Assets/Scripts/Studio/UI/Panel/Panel_ObjectDistance.cs b/Assets/Scripts/Studio/UI/Panel/Panel_ObjectDistance.cs index f6200578..f50c4514 100644 --- a/Assets/Scripts/Studio/UI/Panel/Panel_ObjectDistance.cs +++ b/Assets/Scripts/Studio/UI/Panel/Panel_ObjectDistance.cs @@ -6,6 +6,7 @@ using Studio.Util; using XRLib; using XRLib.UI; using Studio.AssetTool; +using Studio.Manage; namespace Studio.UI { @@ -44,7 +45,7 @@ namespace Studio.UI private void Update() { - if (selectedObject == null || selectedObject.isCollided) + if (selectedObject == null || selectedObject.isCollided || ManagerHub.instance.Get().curState == RunManager.EState.Run) { DeactivateAll(); return;