完善3D解剖功能
This commit is contained in:
parent
ca82f68f37
commit
f369006cd9
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -84,6 +84,6 @@ public class ObjDrag : MonoBehaviour
|
||||
// 在这里可以添加你想要执行的双击逻辑
|
||||
// 例如,将物体重置到起始位置
|
||||
//transform.position = startPosition;
|
||||
transform.DOMove(startPosition, 0.3f);
|
||||
transform.DOMove(startPosition, 0.1f);
|
||||
}
|
||||
}
|
||||
14
Assets/Scripts/UI/UIBody3D.Designer.cs
generated
14
Assets/Scripts/UI/UIBody3D.Designer.cs
generated
@ -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;
|
||||
|
||||
@ -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,12 +92,38 @@ 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 = "Òþ²Ø";
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
protected override void OnOpen(IUIData uiData = null)
|
||||
{
|
||||
if (uiData!=null)
|
||||
if (uiData != null)
|
||||
{
|
||||
mData = uiData as UIBody3DData ?? new UIBody3DData();
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user