Browse Source

隐藏绑定按钮

develop
杨栋梁 12 months ago
parent
commit
732253e7e0
  1. 112
      Assets/LongZhiMeng/Prefab/ShiNei/nei-2.prefab
  2. 45
      Assets/Scripts/ANet/DeviceBind.cs
  3. 15
      Assets/Scripts/ANet/DeviceItem.cs
  4. 17
      Assets/Scripts/ANet/DeviceObj.cs
  5. 43
      Assets/Scripts/ANet/DevicePanelManager.cs
  6. 2
      Assets/Scripts/ANet/Prefabs/DeviceItem.prefab
  7. 2
      Assets/Scripts/ANet/Prefabs/Devices.prefab
  8. 3
      Assets/Scripts/ANet/Prefabs/Point.prefab

112
Assets/LongZhiMeng/Prefab/ShiNei/nei-2.prefab

@ -3839,7 +3839,6 @@ GameObject:
- component: {fileID: 4031327086866037239} - component: {fileID: 4031327086866037239}
- component: {fileID: 7077182373080507910} - component: {fileID: 7077182373080507910}
- component: {fileID: 648309727317344874} - component: {fileID: 648309727317344874}
- component: {fileID: 5316555523566629554}
m_Layer: 9 m_Layer: 9
m_Name: BF_Beng4 m_Name: BF_Beng4
m_TagString: Untagged m_TagString: Untagged
@ -4077,19 +4076,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3} m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &5316555523566629554
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2326997429451289726}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740b18542139ee9469c8e41c0175ef99, type: 3}
m_Name:
m_EditorClassIdentifier:
BindType: 1
--- !u!1 &2353157914987251643 --- !u!1 &2353157914987251643
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -5572,7 +5558,6 @@ GameObject:
- component: {fileID: 5287985838862105051} - component: {fileID: 5287985838862105051}
- component: {fileID: 3886733085689299053} - component: {fileID: 3886733085689299053}
- component: {fileID: 5900376028175799930} - component: {fileID: 5900376028175799930}
- component: {fileID: 5956888857602140127}
m_Layer: 9 m_Layer: 9
m_Name: BF_Beng6 m_Name: BF_Beng6
m_TagString: Untagged m_TagString: Untagged
@ -5810,19 +5795,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3} m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &5956888857602140127
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3042978852869849127}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740b18542139ee9469c8e41c0175ef99, type: 3}
m_Name:
m_EditorClassIdentifier:
BindType: 1
--- !u!1 &3074018658521419042 --- !u!1 &3074018658521419042
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -5839,7 +5811,6 @@ GameObject:
- component: {fileID: 2559636814166329965} - component: {fileID: 2559636814166329965}
- component: {fileID: 3185391126076523883} - component: {fileID: 3185391126076523883}
- component: {fileID: 2464205267263184235} - component: {fileID: 2464205267263184235}
- component: {fileID: 1268469069279118851}
m_Layer: 9 m_Layer: 9
m_Name: BF_Beng5 m_Name: BF_Beng5
m_TagString: Untagged m_TagString: Untagged
@ -6077,19 +6048,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3} m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &1268469069279118851
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3074018658521419042}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740b18542139ee9469c8e41c0175ef99, type: 3}
m_Name:
m_EditorClassIdentifier:
BindType: 1
--- !u!1 &3079525204607243430 --- !u!1 &3079525204607243430
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -7264,7 +7222,6 @@ GameObject:
- component: {fileID: 4937732800351621372} - component: {fileID: 4937732800351621372}
- component: {fileID: 3706227644191310831} - component: {fileID: 3706227644191310831}
- component: {fileID: 1909279315814935535} - component: {fileID: 1909279315814935535}
- component: {fileID: 5073485994584401826}
m_Layer: 9 m_Layer: 9
m_Name: BF_Beng3 m_Name: BF_Beng3
m_TagString: Untagged m_TagString: Untagged
@ -7502,19 +7459,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3} m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &5073485994584401826
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3786473117089836571}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740b18542139ee9469c8e41c0175ef99, type: 3}
m_Name:
m_EditorClassIdentifier:
BindType: 1
--- !u!1 &3788032133742242516 --- !u!1 &3788032133742242516
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -10779,7 +10723,6 @@ GameObject:
- component: {fileID: 4131269442587860886} - component: {fileID: 4131269442587860886}
- component: {fileID: 3729722111198336993} - component: {fileID: 3729722111198336993}
- component: {fileID: 6673500913827426579} - component: {fileID: 6673500913827426579}
- component: {fileID: 4716404738186179804}
m_Layer: 9 m_Layer: 9
m_Name: BF_Beng0 m_Name: BF_Beng0
m_TagString: Untagged m_TagString: Untagged
@ -11017,19 +10960,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3} m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &4716404738186179804
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5594357906926426870}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740b18542139ee9469c8e41c0175ef99, type: 3}
m_Name:
m_EditorClassIdentifier:
BindType: 1
--- !u!1 &5627440744978564017 --- !u!1 &5627440744978564017
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -12235,7 +12165,6 @@ GameObject:
- component: {fileID: 6359272789119930557} - component: {fileID: 6359272789119930557}
- component: {fileID: 5498266817984549803} - component: {fileID: 5498266817984549803}
- component: {fileID: 7760720744530228053} - component: {fileID: 7760720744530228053}
- component: {fileID: 260300424443423364}
m_Layer: 9 m_Layer: 9
m_Name: BF_Beng1 m_Name: BF_Beng1
m_TagString: Untagged m_TagString: Untagged
@ -12473,19 +12402,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3} m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &260300424443423364
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6200839019434489611}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740b18542139ee9469c8e41c0175ef99, type: 3}
m_Name:
m_EditorClassIdentifier:
BindType: 1
--- !u!1 &6220262723648622183 --- !u!1 &6220262723648622183
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -17354,7 +17270,6 @@ GameObject:
- component: {fileID: 7044227335787967364} - component: {fileID: 7044227335787967364}
- component: {fileID: 492251404278482733} - component: {fileID: 492251404278482733}
- component: {fileID: 4466559575882566828} - component: {fileID: 4466559575882566828}
- component: {fileID: 2741434232488103668}
m_Layer: 9 m_Layer: 9
m_Name: BF_Beng7 m_Name: BF_Beng7
m_TagString: Untagged m_TagString: Untagged
@ -17592,19 +17507,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3} m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &2741434232488103668
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8489328720269340209}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740b18542139ee9469c8e41c0175ef99, type: 3}
m_Name:
m_EditorClassIdentifier:
BindType: 1
--- !u!1 &8503116314495135405 --- !u!1 &8503116314495135405
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -17881,7 +17783,6 @@ GameObject:
- component: {fileID: 9122696232950967575} - component: {fileID: 9122696232950967575}
- component: {fileID: 3920252984869914113} - component: {fileID: 3920252984869914113}
- component: {fileID: 7818056208332781246} - component: {fileID: 7818056208332781246}
- component: {fileID: 4325888694603943696}
m_Layer: 9 m_Layer: 9
m_Name: BF_Beng2 m_Name: BF_Beng2
m_TagString: Untagged m_TagString: Untagged
@ -18119,19 +18020,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3} m_Script: {fileID: 11500000, guid: 8fdf5db6d3c50854e820a4c31d098346, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &4325888694603943696
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8711429766819222879}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740b18542139ee9469c8e41c0175ef99, type: 3}
m_Name:
m_EditorClassIdentifier:
BindType: 1
--- !u!1 &8781817313093410746 --- !u!1 &8781817313093410746
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

45
Assets/Scripts/ANet/DeviceBind.cs

@ -11,7 +11,13 @@ public class DeviceBind : MonoBehaviour
public GameObject BindePrefab; public GameObject BindePrefab;
public Text Title; public Text Title;
public Button CloseBtn; public Button CloseBtn;
private void OnDisable()
{
if (DeviceInfo.Instance.gameObject.activeSelf)
{
DeviceInfo.Instance.gameObject.SetActive(false);
}
}
public void DataBind(DeviceType bindType, List<DeviceList> binddata, string bindobjname = null) public void DataBind(DeviceType bindType, List<DeviceList> binddata, string bindobjname = null)
{ {
Title.text = bindType.ToString() + "列表"; Title.text = bindType.ToString() + "列表";
@ -29,24 +35,25 @@ public class DeviceBind : MonoBehaviour
{ {
GameObject go = Instantiate(BindePrefab, BindParent); GameObject go = Instantiate(BindePrefab, BindParent);
Color showColor = Color.white; Color showColor = Color.white;
foreach (var de in DevicePanelManager.Instance.BindObjectList) //颜色设置
{ //foreach (var de in DevicePanelManager.Instance.BindObjectList)
if (!string.IsNullOrEmpty(de.ObjName)) //{
{ // if (!string.IsNullOrEmpty(de.ObjName))
if (de.DeviceId == item.deviceNo) // {
{ // if (de.DeviceId == item.deviceNo)
if (de.ObjName == bindobjname) // {
{ // if (de.ObjName == bindobjname)
showColor = Color.red; // {
} // showColor = Color.red;
else // }
{ // else
showColor = Color.yellow; // {
} // showColor = Color.yellow;
break; // }
} // break;
} // }
} // }
//}
go.GetComponent<DeviceItem>().DataBind(item, showColor); go.GetComponent<DeviceItem>().DataBind(item, showColor);
} }
if (binddata.Count == 0) if (binddata.Count == 0)

15
Assets/Scripts/ANet/DeviceItem.cs

@ -17,7 +17,20 @@ public class DeviceItem : MonoBehaviour
LocalBtn.onClick.AddListener(LocalBtn_Click); LocalBtn.onClick.AddListener(LocalBtn_Click);
ViewBtn.onClick.AddListener(ViewBtn_Click); ViewBtn.onClick.AddListener(ViewBtn_Click);
} }
private void Update()
{
if (Input.GetKey(KeyCode.Q))
{
if (Input.GetKeyDown(KeyCode.O))
{
LocalBtn.gameObject.SetActive(true);
}
if (Input.GetKeyDown(KeyCode.H))
{
LocalBtn.gameObject.SetActive(false);
}
}
}
public void DataBind(DeviceList bindData, Color showColor) public void DataBind(DeviceList bindData, Color showColor)
{ {
BindData = bindData; BindData = bindData;

17
Assets/Scripts/ANet/DeviceObj.cs

@ -17,17 +17,20 @@ public class DeviceObj : MonoBehaviour
public int floorId = 0; public int floorId = 0;
void Start() void Start()
{ {
MessageDispatcher.AddListener("DeviceMenuChanged", DeviceMenuChanged, "Floor"); MessageDispatcher.AddListener("DeviceMenuChanged", DeviceMenuChanged);
MessageDispatcher.AddListener("FLOORNUMBER", FloorChanged); MessageDispatcher.AddListener("FLOORNUMBER", FloorChanged, "Floor");
} }
private void FloorChanged(IMessage obj) private void FloorChanged(IMessage obj)
{ {
//int number = (int)obj.Data; if (DevicePanelManager.Instance.MenuType == BindType)
//isShow = number == floorId ? true : false; {
//if (tIconObj) int number = (int)obj.Data;
// tIconObj.gameObject.SetActive(isShow); isShow = number == floorId ? true : false;
//gameObject.GetComponent<MeshRenderer>().enabled = isShow; if (tIconObj)
tIconObj.gameObject.SetActive(isShow);
gameObject.GetComponent<MeshRenderer>().enabled = isShow;
}
} }
private void DeviceMenuChanged(IMessage obj) private void DeviceMenuChanged(IMessage obj)

43
Assets/Scripts/ANet/DevicePanelManager.cs

@ -38,6 +38,15 @@ public class diveceSourceData
public string sign; public string sign;
public long timestamp; public long timestamp;
} }
public class diveceAlarmData
{
public int currentPage;
public int pageSize;
public long buildingId;
public string type;//fire fault type事件类型(fire=火警, fault=故障)
public string sign;
public long timestamp;
}
[Serializable] [Serializable]
public class PageInfoList<T> public class PageInfoList<T>
{ {
@ -161,6 +170,40 @@ public class DeviceList
public string zone { get; set; } public string zone { get; set; }
} }
[Serializable]
public class TotaDivecelAlarmInfo
{
/// <summary>
/// 状态码
/// </summary>
public int? code { get; set; }
/// <summary>
/// 数据
/// </summary>
public PageInfoList<DeviceAlarmList> data { get; set; }
/// <summary>
/// 消息
/// </summary>
public string message { get; set; }
}
[Serializable]
public class DeviceAlarmList
{
public string alarmTime;
public string createTime;
public string descript;
public string deviceName;
public string deviceNo;
public int deviceType;
public string deviceTypeName;
public string handleAlarmTime;
public string handlePeople;
public string handlePhone;
public string id;
public string modifyTime;
public int state;
public int status;
}
#pragma warning restore IDE1006 // 命名样式 #pragma warning restore IDE1006 // 命名样式
#endregion #endregion
//diviceid(136-用户信息传输装置, 258-消防水泵状态, 401-消防水箱水位, //diviceid(136-用户信息传输装置, 258-消防水泵状态, 401-消防水箱水位,

2
Assets/Scripts/ANet/Prefabs/DeviceItem.prefab

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

2
Assets/Scripts/ANet/Prefabs/Devices.prefab

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

3
Assets/Scripts/ANet/Prefabs/Point.prefab

@ -29,7 +29,7 @@ Transform:
m_GameObject: {fileID: 3051062197270240133} m_GameObject: {fileID: 3051062197270240133}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
@ -111,3 +111,4 @@ MonoBehaviour:
tIcon: {fileID: 2165570965609724972, guid: 85a6b279122fde645be21030eae0c2b4, type: 3} tIcon: {fileID: 2165570965609724972, guid: 85a6b279122fde645be21030eae0c2b4, type: 3}
tIconObj: {fileID: 0} tIconObj: {fileID: 0}
isShow: 0 isShow: 0
floorId: 0

Loading…
Cancel
Save