diff --git a/Assets/Scripts/Studio/Managers/CameraManager.cs b/Assets/Scripts/Studio/Managers/CameraManager.cs index bcd99d05..5dbf3aef 100644 --- a/Assets/Scripts/Studio/Managers/CameraManager.cs +++ b/Assets/Scripts/Studio/Managers/CameraManager.cs @@ -14,8 +14,10 @@ namespace Studio.Manage viewAngle = new Vector3(45, 145, 0); } - public void MoveToTwinObjectPos(TwinObject target) + public void MoveToTwinObjectPos(GameObject target) { + if (target == null) + return; var command = new MoveToTargetCommand(target.transform, viewAngle, cameraDistance); CommandInvoker.instance.Invoke(command); } diff --git a/Assets/Scripts/Studio/Managers/UserInputManager.cs b/Assets/Scripts/Studio/Managers/UserInputManager.cs index 6a79b145..ac5f4d4f 100644 --- a/Assets/Scripts/Studio/Managers/UserInputManager.cs +++ b/Assets/Scripts/Studio/Managers/UserInputManager.cs @@ -1,7 +1,9 @@ using System; using System.Collections; using System.Collections.Generic; +using TMPro; using UnityEngine; +using UnityEngine.EventSystems; using XRLib; namespace Studio.Manage @@ -106,6 +108,9 @@ namespace Studio.Manage } void Update() { + if (IsEditInputField()) + return; + foreach (var key in downKeyActionTable.Keys) { if (Input.GetKeyDown(key)) @@ -149,5 +154,15 @@ namespace Studio.Manage updateLoop?.Invoke(); } + + bool IsEditInputField() + { + GameObject selectedObj = EventSystem.current.currentSelectedGameObject; + + if (selectedObj == null) + return false; + + return selectedObj.GetComponent() != null; + } } } diff --git a/Assets/Scripts/Studio/UI/Panel/Panel_InterferedObjectList.cs b/Assets/Scripts/Studio/UI/Panel/Panel_InterferedObjectList.cs index 08f4ff84..0989491c 100644 --- a/Assets/Scripts/Studio/UI/Panel/Panel_InterferedObjectList.cs +++ b/Assets/Scripts/Studio/UI/Panel/Panel_InterferedObjectList.cs @@ -30,7 +30,7 @@ namespace Studio.UI public void CreateContentButton((TwinObject, TwinObject) pair) { var newButton = Object.Instantiate(buttonPrefab, content).GetComponent(); - newButton.OnClickButton += cameraManager.MoveToTwinObjectPos; + //newButton.OnClickButton += cameraManager.MoveToTwinObjectPos; newButton.Initialize(pair.Item1, pair.Item2); createdButtons.Add(pair, newButton); } diff --git a/Assets/Scripts/Studio/UI/TreeView/HierarchyPooledScrollView.cs b/Assets/Scripts/Studio/UI/TreeView/HierarchyPooledScrollView.cs index 601b7b1f..92562a0b 100644 --- a/Assets/Scripts/Studio/UI/TreeView/HierarchyPooledScrollView.cs +++ b/Assets/Scripts/Studio/UI/TreeView/HierarchyPooledScrollView.cs @@ -258,15 +258,15 @@ namespace Studio.HierarchyTree } public void OnSelectSingle(HierarchyItem item) { - if (selectedItems.Count == 1 && selectedItems[0] == item) - { - selectedItems.Clear(); - } - else - { + //if (selectedItems.Count == 1 && selectedItems[0] == item) + //{ + // selectedItems.Clear(); + //} + //else + //{ selectedItems.Clear(); selectedItems.Add(item); - } + //} foreach (var itemUI in activeItems) { itemUI.SetSelected(selectedItems); diff --git a/Assets/Scripts/Studio/UI/TreeView/HierarchyScrollRect.cs b/Assets/Scripts/Studio/UI/TreeView/HierarchyScrollRect.cs index f191a53d..5fa9554b 100644 --- a/Assets/Scripts/Studio/UI/TreeView/HierarchyScrollRect.cs +++ b/Assets/Scripts/Studio/UI/TreeView/HierarchyScrollRect.cs @@ -6,6 +6,7 @@ using UnityEngine.Events; using UnityEngine.EventSystems; using UnityEngine.UI; using Studio.UI; +using Studio.Manage; namespace Studio.HierarchyTree { @@ -24,6 +25,9 @@ namespace Studio.HierarchyTree private HierarchyScrollItemUI hoverItemUI; private Coroutine coroutinePendPopup; public UnityEvent onExit; + private float lastClickTime = 0f; + private const float doubleClickInterval = 0.3f; + public override void OnBeginDrag(PointerEventData eventData) { if (eventData.button != PointerEventData.InputButton.Left) @@ -83,8 +87,6 @@ namespace Studio.HierarchyTree } } - - public override void OnEndDrag(PointerEventData eventData) { if (eventData.button == PointerEventData.InputButton.Left) @@ -142,19 +144,29 @@ namespace Studio.HierarchyTree base.OnEndDrag(eventData); } } + public void OnPointerDown(PointerEventData eventData) { if (eventData.button == PointerEventData.InputButton.Left) { HierarchyScrollItemUI itemUI = GetTargetItemUI(eventData); + if (itemUI != null) { sourceItem = itemUI.currentItem; + + float timeSinceLastClick = Time.time - lastClickTime; + + if (timeSinceLastClick <= doubleClickInterval) + { + ManagerHub.instance.Get().MoveToTwinObjectPos(sourceItem.linkedObject); + } } if (sourceItem != null) { coroutinePendPopup = StartCoroutine(CoroutinePendPopup()); } + lastClickTime = Time.time; } } public void OnPointerUp(PointerEventData eventData) diff --git a/ProjectSettings/LocalizationSettings.asset b/ProjectSettings/LocalizationSettings.asset index 652b53df..3bdef6a5 100644 --- a/ProjectSettings/LocalizationSettings.asset +++ b/ProjectSettings/LocalizationSettings.asset @@ -14,7 +14,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_StringTable: m_TableReference: - m_TableCollectionName: + m_TableCollectionName: GUID:ab1e4fa9b84503341a204ed3ec095aa8 m_AssetTable: m_TableReference: m_TableCollectionName: diff --git a/ServerData/StandaloneWindows64/catalog_0.1.bin b/ServerData/StandaloneWindows64/catalog_0.1.bin index ddcddac6..5e9da1a6 100644 Binary files a/ServerData/StandaloneWindows64/catalog_0.1.bin and b/ServerData/StandaloneWindows64/catalog_0.1.bin differ diff --git a/ServerData/StandaloneWindows64/catalog_0.1.hash b/ServerData/StandaloneWindows64/catalog_0.1.hash index c8d9c221..33d98f76 100644 --- a/ServerData/StandaloneWindows64/catalog_0.1.hash +++ b/ServerData/StandaloneWindows64/catalog_0.1.hash @@ -1 +1 @@ -000e1e56b63491cd2948148ccce2b84c \ No newline at end of file +77439a0de80e9b4861c25c52b97dc770 \ No newline at end of file