Merge pull request 'pgd/20250624 Task' (#177) from pgd/20250624_1 into main

Reviewed-on: http://220.90.135.190:3000/UVCXR/Studio/pulls/177
This commit was merged in pull request #177.
This commit is contained in:
pgd
2025-06-24 11:59:28 +09:00
8 changed files with 42 additions and 13 deletions

View File

@@ -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);
}

View File

@@ -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<TMP_InputField>() != null;
}
}
}

View File

@@ -30,7 +30,7 @@ namespace Studio.UI
public void CreateContentButton((TwinObject, TwinObject) pair)
{
var newButton = Object.Instantiate(buttonPrefab, content).GetComponent<UI_InterferedObjectButton>();
newButton.OnClickButton += cameraManager.MoveToTwinObjectPos;
//newButton.OnClickButton += cameraManager.MoveToTwinObjectPos;
newButton.Initialize(pair.Item1, pair.Item2);
createdButtons.Add(pair, newButton);
}

View File

@@ -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);

View File

@@ -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<HierarchyItem> 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<CameraManager>().MoveToTwinObjectPos(sourceItem.linkedObject);
}
}
if (sourceItem != null)
{
coroutinePendPopup = StartCoroutine(CoroutinePendPopup());
}
lastClickTime = Time.time;
}
}
public void OnPointerUp(PointerEventData eventData)

View File

@@ -14,7 +14,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_StringTable:
m_TableReference:
m_TableCollectionName:
m_TableCollectionName: GUID:ab1e4fa9b84503341a204ed3ec095aa8
m_AssetTable:
m_TableReference:
m_TableCollectionName:

View File

@@ -1 +1 @@
000e1e56b63491cd2948148ccce2b84c
77439a0de80e9b4861c25c52b97dc770