diff --git a/BulkCargo_UnityProject/Assets/Resources/Prefabs/UI/DeviceIcons/YardNameIcon.prefab b/BulkCargo_UnityProject/Assets/Resources/Prefabs/UI/DeviceIcons/YardNameIcon.prefab
index 0526f8d3..26477ea0 100644
--- a/BulkCargo_UnityProject/Assets/Resources/Prefabs/UI/DeviceIcons/YardNameIcon.prefab
+++ b/BulkCargo_UnityProject/Assets/Resources/Prefabs/UI/DeviceIcons/YardNameIcon.prefab
@@ -60,7 +60,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
- m_RaycastTarget: 1
+ m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
@@ -199,7 +199,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
- m_RaycastTarget: 1
+ m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
@@ -241,4 +241,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: af498aa5614b7e047a8f4fe18e5327c8, type: 3}
m_Name:
m_EditorClassIdentifier:
+ DeviceBase: {fileID: 0}
+ DeviceIndex:
DeviceNameText: {fileID: 6367114157914357126}
diff --git a/BulkCargo_UnityProject/Assets/Scenes/福州海关/蓉城海关/华能(福建)海港有限公司海关监管场所.unity b/BulkCargo_UnityProject/Assets/Scenes/福州海关/蓉城海关/华能(福建)海港有限公司海关监管场所.unity
index 4ce0237d..dfef1d92 100644
--- a/BulkCargo_UnityProject/Assets/Scenes/福州海关/蓉城海关/华能(福建)海港有限公司海关监管场所.unity
+++ b/BulkCargo_UnityProject/Assets/Scenes/福州海关/蓉城海关/华能(福建)海港有限公司海关监管场所.unity
@@ -6086,6 +6086,7 @@ MonoBehaviour:
YardMaxWeight: 60000000
MinimumPercentage: 0.1
ParticleSystem: {fileID: 0}
+ NameIconOffset: {x: 0, y: 0, z: -75}
--- !u!65 &271908282
BoxCollider:
m_ObjectHideFlags: 0
@@ -6231,6 +6232,7 @@ MonoBehaviour:
YardMaxWeight: 60000000
MinimumPercentage: 0.1
ParticleSystem: {fileID: 0}
+ NameIconOffset: {x: 0, y: 0, z: 0}
--- !u!65 &341412933
BoxCollider:
m_ObjectHideFlags: 0
@@ -12042,6 +12044,7 @@ MonoBehaviour:
YardMaxWeight: 80000000
MinimumPercentage: 0.1
ParticleSystem: {fileID: 0}
+ NameIconOffset: {x: 0, y: 0, z: 0}
--- !u!65 &507878043
BoxCollider:
m_ObjectHideFlags: 0
@@ -12918,6 +12921,7 @@ MonoBehaviour:
YardMaxWeight: 80000000
MinimumPercentage: 0.1
ParticleSystem: {fileID: 0}
+ NameIconOffset: {x: 0, y: 0, z: -75}
--- !u!65 &690684754
BoxCollider:
m_ObjectHideFlags: 0
@@ -13137,6 +13141,7 @@ MonoBehaviour:
YardMaxWeight: 80000000
MinimumPercentage: 0.1
ParticleSystem: {fileID: 0}
+ NameIconOffset: {x: 0, y: 0, z: 75}
--- !u!65 &717536052
BoxCollider:
m_ObjectHideFlags: 0
@@ -20403,6 +20408,7 @@ MonoBehaviour:
YardMaxWeight: 80000000
MinimumPercentage: 0.1
ParticleSystem: {fileID: 0}
+ NameIconOffset: {x: 0, y: 0, z: 75}
--- !u!65 &1185296017
BoxCollider:
m_ObjectHideFlags: 0
diff --git a/BulkCargo_UnityProject/Assets/Scripts/wj/Device/YardDevice.cs b/BulkCargo_UnityProject/Assets/Scripts/wj/Device/YardDevice.cs
index b0d252f3..121ec86a 100644
--- a/BulkCargo_UnityProject/Assets/Scripts/wj/Device/YardDevice.cs
+++ b/BulkCargo_UnityProject/Assets/Scripts/wj/Device/YardDevice.cs
@@ -72,6 +72,11 @@ public class YardDevice : DeviceBase
///
DeviceName DeviceName;
+ ///
+ /// չʾƫ
+ ///
+ public Vector3 NameIconOffset;
+
public override void Awake()
{
base.Awake();
@@ -210,27 +215,27 @@ public class YardDevice : DeviceBase
ParticleSystem.Play();
//չʾѳ
- DeviceName = ObjectPool.Get();
- if (DeviceName == null)
- {
- DeviceName = Instantiate(Resources.Load("Prefabs/UI/DeviceIcons/YardNameIcon"));
- DeviceName.transform.parent = ModelRoot.Instance.Canvas_3D;
+ //DeviceName = ObjectPool.Get();
+ //if (DeviceName == null)
+ //{
+ // DeviceName = Instantiate(Resources.Load("Prefabs/UI/DeviceIcons/YardNameIcon"));
+ // DeviceName.transform.parent = ModelRoot.Instance.Canvas_3D;
- DeviceName.transform.position = transform.position;
- DeviceName.NameText(T_BAS_YARD.YARD_NAME);
- }
- else
- {
- DeviceName.transform.position = transform.position;
- DeviceName.NameText(T_BAS_YARD.YARD_NAME);
- }
+ // DeviceName.transform.position = transform.position;
+ // DeviceName.NameText(T_BAS_YARD.YARD_NAME);
+ //}
+ //else
+ //{
+ // DeviceName.transform.position = transform.position;
+ // DeviceName.NameText(T_BAS_YARD.YARD_NAME);
+ //}
}
else
{
ParticleSystem.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
//ضѳ
- ObjectPool.Store(DeviceName);
+ //ObjectPool.Store(DeviceName);
}
}
diff --git a/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/MainScene.cs b/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/MainScene.cs
index c46fcbcd..5c208dc6 100644
--- a/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/MainScene.cs
+++ b/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/MainScene.cs
@@ -76,6 +76,14 @@ public class MainScene : Singleton
//var _yard_icon = Instantiate(ModelRoot.Instance.YardIconPrefab, ModelRoot.Instance.Canvas_3D);
//_yard_icon.transform.position = DeviceBase.DeviceBaseList[i].transform.position;
//_yard_icon.GetComponent().InitModel(DeviceBase.DeviceBaseList[i]);
+ if (ModelRoot.Instance.YardNameIcon == null)
+ {
+ ModelRoot.Instance.YardNameIcon = Resources.Load("Prefabs/UI/DeviceIcons/YardNameIcon") as GameObject;
+ }
+ var _yard = DeviceBase.DeviceBaseList[i] as YardDevice;
+ var _yard_icon = Instantiate(ModelRoot.Instance.YardNameIcon, ModelRoot.Instance.Canvas_3D);
+ _yard_icon.transform.position = _yard.transform.position + _yard.NameIconOffset;
+ _yard_icon.GetComponent().InitModel(DeviceBase.DeviceBaseList[i]);
break;
default:
break;
diff --git a/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/ModelRoot.cs b/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/ModelRoot.cs
index 4c62314c..a54781c3 100644
--- a/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/ModelRoot.cs
+++ b/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/ModelRoot.cs
@@ -31,6 +31,10 @@ public class ModelRoot : Singleton
///Ԥ-ѳUIͼ
///
public GameObject YardIconPrefab;
+ ///
+ /// Ԥ-ѳͼ
+ ///
+ public GameObject YardNameIcon;
public override void Awake()
{
diff --git a/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/UIManager.cs b/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/UIManager.cs
index ee2ae3da..badf0021 100644
--- a/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/UIManager.cs
+++ b/BulkCargo_UnityProject/Assets/Scripts/wj/Manager/UIManager.cs
@@ -129,7 +129,9 @@ public class UIManager : Singleton
}
}));
}
-
+ ///
+ ///
+ ///
void ClaerSearch()
{
ClaerSearch(true);
diff --git a/BulkCargo_UnityProject/Assets/Scripts/wj/UI/DeviceName.cs b/BulkCargo_UnityProject/Assets/Scripts/wj/UI/DeviceName.cs
index 4cb19704..7604e959 100644
--- a/BulkCargo_UnityProject/Assets/Scripts/wj/UI/DeviceName.cs
+++ b/BulkCargo_UnityProject/Assets/Scripts/wj/UI/DeviceName.cs
@@ -1,9 +1,10 @@
+using Competition.Mysql.Model;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
-public class DeviceName : MonoBehaviour
+public class DeviceName : DeviceUIBase
{
[SerializeField]
private TextMeshProUGUI DeviceNameText;
@@ -12,4 +13,11 @@ public class DeviceName : MonoBehaviour
{
DeviceNameText.text = _name;
}
+
+ public override void InitData()
+ {
+ base.InitData();
+
+ NameText(DeviceBase.T_BAS_YARD.YARD_NAME);
+ }
}