|
|
@@ -7,6 +7,7 @@ using UnityEngine.UI;
|
|
|
using System.IO;
|
|
|
using System.Linq;
|
|
|
using QFramework;
|
|
|
+using System.Reflection;
|
|
|
|
|
|
public class MoveItemManager : MonoBehaviour
|
|
|
{
|
|
|
@@ -31,6 +32,7 @@ public class MoveItemManager : MonoBehaviour
|
|
|
/// </summary>
|
|
|
bool useAudioCtrl;
|
|
|
|
|
|
+ public ModelItem m_CurrentSelectModelItem;
|
|
|
private void Awake()
|
|
|
{
|
|
|
instance = this;
|
|
|
@@ -38,6 +40,61 @@ public class MoveItemManager : MonoBehaviour
|
|
|
UIKit.OpenPanel<AutoDisassemblyPanel>();
|
|
|
}
|
|
|
|
|
|
+ public void Update()
|
|
|
+ {
|
|
|
+ Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
|
|
+ RaycastHit hit;
|
|
|
+
|
|
|
+ if (Physics.Raycast(ray, out hit))
|
|
|
+ {
|
|
|
+ ModelItem modelItem = GetParentPartMarkWithModelItem(hit.collider.transform);
|
|
|
+
|
|
|
+ if (m_CurrentSelectModelItem != modelItem)
|
|
|
+ {
|
|
|
+ if (m_CurrentSelectModelItem != null)
|
|
|
+ {
|
|
|
+ m_CurrentSelectModelItem.CloseHighlighter();
|
|
|
+ }
|
|
|
+ m_CurrentSelectModelItem = modelItem;
|
|
|
+ m_CurrentSelectModelItem.OpenHighlighter();
|
|
|
+ }
|
|
|
+ // 处理射线击中的对象
|
|
|
+ if (modelItem != null)
|
|
|
+ {
|
|
|
+ UIKit.GetPanel<AutoDisassemblyPanel>().SetSubTitleText(modelItem.name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (m_CurrentSelectModelItem != null)
|
|
|
+ {
|
|
|
+ m_CurrentSelectModelItem.CloseHighlighter();
|
|
|
+ m_CurrentSelectModelItem = null;
|
|
|
+
|
|
|
+
|
|
|
+ UIKit.GetPanel<AutoDisassemblyPanel>().SetSubTitleText("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 查找携带PartMark的节点
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="traget"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private ModelItem GetParentPartMarkWithModelItem(Transform traget)
|
|
|
+ {
|
|
|
+ ModelItem tmpMark = traget.GetComponent<ModelItem>();
|
|
|
+
|
|
|
+ if (tmpMark == null && traget.parent != null)
|
|
|
+ {
|
|
|
+ tmpMark = GetParentPartMarkWithModelItem(traget.parent);
|
|
|
+ }
|
|
|
+
|
|
|
+ return tmpMark;
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 正向播放
|
|
|
/// </summary>
|
|
|
@@ -90,7 +147,6 @@ public class MoveItemManager : MonoBehaviour
|
|
|
Debug.Log("音频回调");
|
|
|
OnPlayMoveItemByIndexCallBack(index);
|
|
|
}
|
|
|
-
|
|
|
}));
|
|
|
|
|
|
StartCoroutine(MovePathByItem(moveItemInfos[index], false,
|