完善3D解剖功能

This commit is contained in:
shenjianxing 2025-02-19 13:07:05 +08:00
parent ca82f68f37
commit f369006cd9
8 changed files with 984 additions and 18 deletions

File diff suppressed because it is too large Load Diff

View File

@ -696,7 +696,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Content: {fileID: 230997068583847590}
m_Horizontal: 1
m_Horizontal: 0
m_Vertical: 1
m_MovementType: 1
m_Elasticity: 0.1

View File

@ -884,6 +884,7 @@ MonoBehaviour:
distanceMax: 20
pitchMinMax: {x: -20, y: 80}
texture: {fileID: 8400000, guid: 187fba8368491cb428c8cbd324fa9bb4, type: 2}
lockMove: 0
--- !u!222 &102363872365703344
CanvasRenderer:
m_ObjectHideFlags: 0

View File

@ -30,7 +30,7 @@ public class Body3DController : MonoSingleton<Body3DController>
private Vector2 mouseDownPosition; // 记录鼠标按下时的位置
Stack<GameObject> activeObjs = new Stack<GameObject>();
Stack<GameObject> moveObjs = new Stack<GameObject>();
public Stack<GameObject> moveObjs = new Stack<GameObject>();
public override void OnSingletonInit()
{
base.OnSingletonInit();

View File

@ -84,6 +84,6 @@ public class ObjDrag : MonoBehaviour
// 在这里可以添加你想要执行的双击逻辑
// 例如,将物体重置到起始位置
//transform.position = startPosition;
transform.DOMove(startPosition, 0.3f);
transform.DOMove(startPosition, 0.1f);
}
}

View File

@ -5,7 +5,7 @@ using QFramework;
namespace QFramework.Example
{
// Generate Id:72ad2108-5768-445e-af82-c0c5db90d8e7
// Generate Id:b3c99476-8a23-45c1-8eeb-fca6bca1bfda
public partial class UIBody3D
{
public const string Name = "UIBody3D";
@ -15,16 +15,20 @@ namespace QFramework.Example
[SerializeField]
public RectTransform BodyList;
[SerializeField]
public RectTransform LeftContent;
[SerializeField]
public UnityEngine.UI.Button ResetBtn;
[SerializeField]
public UnityEngine.UI.Toggle HideAll;
[SerializeField]
public RectTransform LeftContent;
[SerializeField]
public UnityEngine.UI.Toggle ActiveBtn;
[SerializeField]
public UnityEngine.UI.Button ActiveBack;
[SerializeField]
public UnityEngine.UI.Toggle DragBtn;
[SerializeField]
public UnityEngine.UI.Button DragReset;
[SerializeField]
public UnityEngine.UI.Button DragBack;
[SerializeField]
public UnityEngine.UI.Button MenuBtn;
@ -39,11 +43,13 @@ namespace QFramework.Example
{
BodyContent = null;
BodyList = null;
LeftContent = null;
ResetBtn = null;
HideAll = null;
LeftContent = null;
ActiveBtn = null;
ActiveBack = null;
DragBtn = null;
DragReset = null;
DragBack = null;
MenuBtn = null;
BodyItem = null;

View File

@ -4,7 +4,7 @@ using XMLTool;
using TMPro;
using System.Collections.Generic;
using static XMLTool.Body3D;
using UnityEngine.Assertions.Must;
using DG.Tweening;
namespace QFramework.Example
{
@ -92,6 +92,32 @@ namespace QFramework.Example
UIKit.OpenPanelAsync<UIBody3DMenuTree>(canvasLevel: UILevel.PopUI, new UIBody3DMenuTreeData() { body = mData.body }).ToAction().StartGlobal();
Hide();
});
DragReset.onClick.AddListener(() =>
{
while (Body3DController.Instance.moveObjs.Count > 0)
{
GameObject obj = Body3DController.Instance.PopMoveObj();
if (obj != null)
{
obj.GetComponent<ObjDrag>().OnDoubleClick();
}
}
});
HideAll.onValueChanged.AddListener(isOn =>
{
if (isOn)
{
LeftContent.GetComponent<DOTweenAnimation>().DORestart();
HideAll.transform.Find("Label").GetComponent<TextMeshProUGUI>().text = "ÏÔʾ";
}
else
{
LeftContent.GetComponent<DOTweenAnimation>().DOPlayBackwards();
HideAll.transform.Find("Label").GetComponent<TextMeshProUGUI>().text = "Òþ²Ø";
}
});
}

View File

@ -211,13 +211,11 @@ namespace QFramework.Example
});
Input.onSelect.AddListener(str =>
{
Debug.LogError("onSelect:" + str);
SearchContent.gameObject.SetActive(true);
Content.gameObject.SetActive(false);
});
Input.onEndEdit.AddListener(str =>
{
Debug.LogError("onEndEdit:" + str);
if (string.IsNullOrEmpty(str))
{
SearchContent.gameObject.SetActive(false);
@ -239,6 +237,7 @@ namespace QFramework.Example
{
mData = uiData as UIBody3DMenuTreeData ?? new UIBody3DMenuTreeData();
Content.RemoveAllChildren();
objBtnDataMap.Clear();
BuildTreeUI(mData.body);
}
private void BuildTreeUI(Body3D.Body data, int depth = 0, Transform parent = null)