Browse Source

修改ShowDeviceDetail显示逻辑,自定义打开

蓝色星空 1 year ago
parent
commit
9696f10c86

+ 49 - 1
Assets/Game/Blue/0.F/BlueRoot.prefab

@@ -1,5 +1,49 @@
 %YAML 1.1
 %TAG !u! tag:unity3d.com,2011:
+--- !u!1 &8099334051828054534
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 4566161397553809488}
+  - component: {fileID: 996426232482222647}
+  m_Layer: 0
+  m_Name: ShowDevice
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &4566161397553809488
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8099334051828054534}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 3274897787036747888}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &996426232482222647
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8099334051828054534}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 74b5b3bf8eadc3c488880a55afff4f9e, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
 --- !u!1 &8253213312023144010
 GameObject:
   m_ObjectHideFlags: 0
@@ -31,7 +75,8 @@ Transform:
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
-  m_Children: []
+  m_Children:
+  - {fileID: 4566161397553809488}
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -71,6 +116,8 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 13f18050a8125144196cdf02b8eced3c, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  ShowDevice: {fileID: 0}
+  Xunjian2: {fileID: 0}
 --- !u!114 &8415422319146954477
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -83,3 +130,4 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 1680d6e55f580a6409d98f775bd42500, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  blueObject: {fileID: 0}

+ 33 - 0
Assets/Game/Blue/Controller/ShowDeviceControle.cs

@@ -0,0 +1,33 @@
+using UnityEngine;
+using Blue;
+using GHZLangChao;
+
+public class ShowDeviceControle : MonoBehaviour,IController
+{
+    public GameObject ShowDeviceDetails;
+    public  void Awake()
+    {
+        this.RegisterEvent<DeviceDetailsUpdataDataEvent>(e=>
+        {
+            if(DeviceDetailsControl==null)
+            {
+                GameObject go = Instantiate(InstantiateSystem.Instance.BlueObject.ShowDeviceControle, GameStart.Instance.transform.parent);
+                DeviceDetailsControl = go.GetComponent<DeviceDetailsControl>();
+            }
+            DeviceDetailsControl.gameObject.SetActive(true);
+            // 更新数据
+            DeviceDetailsControl.UpdateData(e.DeviceParameter,e.item);
+            // 更新位置
+            DeviceDetailsControl.transform.position = new Vector3(
+               e.currentPos.transform.position.x,
+               0.55f,
+                e.currentPos.transform.position.z);
+            // 更新位置
+            DeviceDetailsControl.transform.eulerAngles = new Vector3(
+              0,
+                e.currentPos.transform.eulerAngles.y,
+               0);
+        }).UnRegisterWhenGameObjectDestroyed(gameObject);
+    }
+    private DeviceDetailsControl DeviceDetailsControl = null;
+}

+ 11 - 0
Assets/Game/Blue/Controller/ShowDeviceControle.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 74b5b3bf8eadc3c488880a55afff4f9e
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 2 - 0
Assets/Game/Blue/ScriptableObject/BlueObject.cs

@@ -8,4 +8,6 @@ public class BlueObject : ScriptableObject
     public GameObject SearchPanel_Item; // ShowDaoHang 面板 -- 搜索面板 ---子物体
     public GameObject FaultPanel_Item; // ShowDaoHang 面板 -- 故障面板 ---子物体
     public GameObject WarningInfoItem; // ShowDeviceDetails 面板 -- WarningInfo ---子物体
+
+    public GameObject ShowDeviceControle; // ShowDeviceDetails 面板 -- WarningInfo ---子物体
 }

+ 1 - 0
Assets/Game/Blue/ScriptableObject/PrefabsAsset.asset

@@ -16,3 +16,4 @@ MonoBehaviour:
   SearchPanel_Item: {fileID: 6531081025574629906, guid: cc07db29cd740d54d974fd3083bae865, type: 3}
   FaultPanel_Item: {fileID: 7400388167945465585, guid: 48d98ef2483f27f41aa2ba8603fa54d5, type: 3}
   WarningInfoItem: {fileID: 8552349058852812674, guid: 80f48a9072eaf8e45940f1bed09e9cab, type: 3}
+  ShowDeviceControle: {fileID: 6107917270000557272, guid: c61a8008bf2355c42ad9c16cde9bc3eb, type: 3}

+ 0 - 24
Assets/Game/ShowDevice/ShowDevice.cs

@@ -1,7 +1,5 @@
 using SC.XR.Unity;
 using Blue;
-using GHZLangChao;
-using UnityEngine;
 
 public class ShowDevice : RemoteSingleton<ShowDevice>,IController
 {
@@ -13,27 +11,5 @@ public class ShowDevice : RemoteSingleton<ShowDevice>,IController
     public override void Awake()
     {
         base.Awake();
-        this.RegisterEvent<DeviceDetailsUpdataDataEvent>(e=>
-        {
-            ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowDevice);
-            ShowDevice.Instance.gotoWindow(ScenesManager.SceneType.DeviceDetails);
-            ShowXunJian.Instance.gameObject.SetActive(true);
-            if(DeviceDetailsControl==null)
-                DeviceDetailsControl = GetComponentInChildren<DeviceDetailsControl>();
-
-            // 更新数据
-            DeviceDetailsControl.UpdateData(e.DeviceParameter,e.item);
-            // 更新位置
-            DeviceDetailsControl.transform.position = new Vector3(
-               e.currentPos.transform.position.x,
-               0.55f,
-                e.currentPos.transform.position.z);
-            // 更新位置
-            DeviceDetailsControl.transform.eulerAngles = new Vector3(
-              0,
-                e.currentPos.transform.eulerAngles.y,
-               0);
-        }).UnRegisterWhenGameObjectDestroyed(gameObject);
     }
-    private DeviceDetailsControl DeviceDetailsControl;
 }

+ 1 - 1
Assets/Game/ShowDevice/ShowDevice.prefab

@@ -1053,7 +1053,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &918491418410476814
 RectTransform:
   m_ObjectHideFlags: 0

+ 9 - 9
Assets/Game/ShowXunJian/ShowDaoHang.prefab

@@ -1070,7 +1070,7 @@ RectTransform:
   - {fileID: 4567179982264683347}
   - {fileID: 41446735723406132}
   m_Father: {fileID: 4530619492051363259}
-  m_RootOrder: 1
+  m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
@@ -1820,7 +1820,7 @@ RectTransform:
   m_Children:
   - {fileID: 4879951303922612038}
   m_Father: {fileID: 4530619492051363259}
-  m_RootOrder: 2
+  m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
@@ -3902,16 +3902,16 @@ RectTransform:
   m_GameObject: {fileID: 6509443255714867062}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 0.5, y: 0.5, z: 1}
+  m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 3985137173825234781}
-  m_Father: {fileID: 4530619492051363259}
+  m_Father: {fileID: 533781171914398967}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
-  m_AnchoredPosition: {x: 504, y: 364.49384}
+  m_AnchoredPosition: {x: 1010.48804, y: 532.9877}
   m_SizeDelta: {x: 272.158, y: 99.6}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &9096303043076951562
@@ -4173,11 +4173,10 @@ RectTransform:
   m_LocalScale: {x: 2, y: 2, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children:
-  - {fileID: 8452669653775307491}
   - {fileID: 2963777041933473432}
   - {fileID: 1945075760931717223}
   m_Father: {fileID: 533781171914398967}
-  m_RootOrder: 0
+  m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
@@ -4727,7 +4726,7 @@ Transform:
   - {fileID: 9021331631229394003}
   - {fileID: 1056066577903891606}
   m_Father: {fileID: 533781171914398967}
-  m_RootOrder: 2
+  m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &7179222928760826613
 GameObject:
@@ -4762,7 +4761,7 @@ RectTransform:
   - {fileID: 594443851951981595}
   - {fileID: 5379945662828256510}
   m_Father: {fileID: 533781171914398967}
-  m_RootOrder: 1
+  m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
@@ -5638,6 +5637,7 @@ RectTransform:
   m_LocalScale: {x: 0.5, y: 0.5, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children:
+  - {fileID: 8452669653775307491}
   - {fileID: 4530619492051363259}
   - {fileID: 4360138172527063656}
   - {fileID: 3333306093384337136}