设备新增、编辑接口字段修改、新增模型94
This commit is contained in:
parent
06a4923b21
commit
c5590b99a9
|
|
@ -20,7 +20,7 @@ public class DeviceItem : MonoBehaviour
|
|||
public int volume;
|
||||
public DragTest1 oriPrefab;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Use this for initialization
|
||||
|
|
@ -57,7 +57,8 @@ public class DeviceItem : MonoBehaviour
|
|||
|
||||
|
||||
}
|
||||
gameObject.AddComponent<ClickEvent>();
|
||||
if (!gameObject.GetComponent<ClickEvent>())
|
||||
gameObject.AddComponent<ClickEvent>();
|
||||
|
||||
//gameObject.AddComponent<BoxCollider>();
|
||||
deviceManager = _deviceManager;
|
||||
|
|
|
|||
|
|
@ -70,9 +70,9 @@ public class DeviceManager : MonoBehaviour
|
|||
{
|
||||
for (int i = 0; i < deviceItems.Count; i++)
|
||||
{
|
||||
deviceItems[i].GetComponent<HighLight_VR>().ShutDownHighlight();
|
||||
//deviceItems[i].GetComponent<HighLight_VR>().ShutDownHighlight();
|
||||
}
|
||||
di.GetComponent<HighLight_VR>().Highlight();
|
||||
//di.GetComponent<HighLight_VR>().Highlight();
|
||||
}
|
||||
|
||||
public void SwitchStagingPanel(GameObject staginDragClone)
|
||||
|
|
|
|||
|
|
@ -81,6 +81,11 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler,
|
|||
{
|
||||
EndDragAction?.Invoke(targetObject);
|
||||
CountUPos();
|
||||
//模型错误微调
|
||||
if (oriObjectPrefab.name == "1" || oriObjectPrefab.name == "14" || oriObjectPrefab.name == "15" || oriObjectPrefab.name == "83")
|
||||
{
|
||||
GameManager.Inst.MoveParentAndChildren(targetObject.transform, new Vector3(-0.25f, 0, 0));
|
||||
}
|
||||
currentUPosItem = null;
|
||||
targetObject = null;
|
||||
|
||||
|
|
@ -132,7 +137,6 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler,
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
//Debug.LogError(12);
|
||||
}
|
||||
}
|
||||
|
|
@ -156,8 +160,8 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler,
|
|||
di = dt.gameObject.AddComponent<DeviceItem>();
|
||||
else
|
||||
di = dt.GetComponent<DeviceItem>();
|
||||
if (di.gameObject.GetComponent<HighLight_VR>() == null)
|
||||
di.gameObject.AddComponent<HighLight_VR>();
|
||||
//if (di.gameObject.GetComponent<HighLight_VR>() == null)
|
||||
//di.gameObject.AddComponent<HighLight_VR>();
|
||||
|
||||
di.Init(deviceManager, index, dt.volume, oriObjectPrefab);
|
||||
deviceManager.SetDeviceItem(di);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ RectTransform:
|
|||
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: 17.4, y: -2.7}
|
||||
m_AnchoredPosition: {x: 14.8, y: -2.7}
|
||||
m_SizeDelta: {x: 293.99, y: 120}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1000062609473158365
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6859162189118081272}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -2}
|
||||
m_LocalPosition: {x: -0.25, y: 0, z: -2}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ MonoBehaviour:
|
|||
frames: []
|
||||
PerTier: 42
|
||||
PerRow: 5
|
||||
volume: 1
|
||||
volume: 42
|
||||
isExit: 0
|
||||
isClicked: 0
|
||||
isTarget: 0
|
||||
|
|
@ -244,5 +244,5 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 6bc0a67b27552c54e893bf2db7023587, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
volume: 1
|
||||
volume: 42
|
||||
selfIcon: {fileID: 21300000, guid: e876e5f1383050b49a2caf8b8a82cf7a, type: 3}
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ MonoBehaviour:
|
|||
frames: []
|
||||
PerTier: 42
|
||||
PerRow: 5
|
||||
volume: 6
|
||||
volume: 3
|
||||
isExit: 0
|
||||
isClicked: 0
|
||||
isTarget: 0
|
||||
|
|
@ -319,7 +319,7 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 6bc0a67b27552c54e893bf2db7023587, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
volume: 6
|
||||
volume: 3
|
||||
selfIcon: {fileID: 21300000, guid: abfde92cf41866d45b3794aecd9a3d35, type: 3}
|
||||
--- !u!1 &526072872669211746
|
||||
GameObject:
|
||||
|
|
|
|||
|
|
@ -901,7 +901,7 @@ MonoBehaviour:
|
|||
frames: []
|
||||
PerTier: 42
|
||||
PerRow: 5
|
||||
volume: 1
|
||||
volume: 3
|
||||
isExit: 0
|
||||
isClicked: 0
|
||||
isTarget: 0
|
||||
|
|
@ -947,7 +947,7 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 6bc0a67b27552c54e893bf2db7023587, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
volume: 1
|
||||
volume: 3
|
||||
selfIcon: {fileID: 21300000, guid: 2e15dc75c4faca943968469c99051cc9, type: 3}
|
||||
--- !u!1 &2944142409948787649
|
||||
GameObject:
|
||||
|
|
|
|||
|
|
@ -745,7 +745,7 @@ MonoBehaviour:
|
|||
frames: []
|
||||
PerTier: 42
|
||||
PerRow: 5
|
||||
volume: 1
|
||||
volume: 3
|
||||
isExit: 0
|
||||
isClicked: 0
|
||||
isTarget: 0
|
||||
|
|
@ -791,7 +791,7 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 6bc0a67b27552c54e893bf2db7023587, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
volume: 1
|
||||
volume: 3
|
||||
selfIcon: {fileID: 21300000, guid: b8e7ce3482bcbbb40b36f2cedafc87bc, type: 3}
|
||||
--- !u!1 &1871673127833003956
|
||||
GameObject:
|
||||
|
|
|
|||
|
|
@ -820,7 +820,7 @@ MonoBehaviour:
|
|||
frames: []
|
||||
PerTier: 42
|
||||
PerRow: 5
|
||||
volume: 6
|
||||
volume: 3
|
||||
isExit: 0
|
||||
isClicked: 0
|
||||
isTarget: 0
|
||||
|
|
@ -866,7 +866,7 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 6bc0a67b27552c54e893bf2db7023587, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
volume: 6
|
||||
volume: 3
|
||||
selfIcon: {fileID: 21300000, guid: 3e670dddb45a95c4d8f369b043380269, type: 3}
|
||||
--- !u!1 &7670571258194673549
|
||||
GameObject:
|
||||
|
|
|
|||
|
|
@ -2177,7 +2177,7 @@ MonoBehaviour:
|
|||
frames: []
|
||||
PerTier: 42
|
||||
PerRow: 5
|
||||
volume: 1
|
||||
volume: 2
|
||||
isExit: 0
|
||||
isClicked: 0
|
||||
isTarget: 0
|
||||
|
|
@ -2223,7 +2223,7 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 6bc0a67b27552c54e893bf2db7023587, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
volume: 1
|
||||
volume: 2
|
||||
selfIcon: {fileID: 21300000, guid: 6725e2395289f4241ac3155dd84f89d8, type: 3}
|
||||
--- !u!1 &7998551715733363309
|
||||
GameObject:
|
||||
|
|
|
|||
|
|
@ -3669,7 +3669,7 @@ MonoBehaviour:
|
|||
frames: []
|
||||
PerTier: 42
|
||||
PerRow: 5
|
||||
volume: 1
|
||||
volume: 4
|
||||
isExit: 0
|
||||
isClicked: 0
|
||||
isTarget: 0
|
||||
|
|
@ -3773,7 +3773,7 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 6bc0a67b27552c54e893bf2db7023587, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
volume: 1
|
||||
volume: 4
|
||||
selfIcon: {fileID: 21300000, guid: 9fd0f80f2e5f0504c96738b9e5b72d30, type: 3}
|
||||
--- !u!1 &7280823576953471714
|
||||
GameObject:
|
||||
|
|
|
|||
|
|
@ -2095,7 +2095,7 @@ MonoBehaviour:
|
|||
frames: []
|
||||
PerTier: 42
|
||||
PerRow: 5
|
||||
volume: 1
|
||||
volume: 4
|
||||
isExit: 0
|
||||
isClicked: 0
|
||||
isTarget: 0
|
||||
|
|
@ -2199,7 +2199,7 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 6bc0a67b27552c54e893bf2db7023587, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
volume: 1
|
||||
volume: 4
|
||||
selfIcon: {fileID: 21300000, guid: 16335f9668ec1084b8ebd6a961074b10, type: 3}
|
||||
--- !u!1 &2910376070214209314
|
||||
GameObject:
|
||||
|
|
|
|||
|
|
@ -5960,7 +5960,7 @@ MonoBehaviour:
|
|||
frames: []
|
||||
PerTier: 42
|
||||
PerRow: 5
|
||||
volume: 1
|
||||
volume: 4
|
||||
isExit: 0
|
||||
isClicked: 0
|
||||
isTarget: 0
|
||||
|
|
@ -6064,7 +6064,7 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 6bc0a67b27552c54e893bf2db7023587, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
volume: 1
|
||||
volume: 4
|
||||
selfIcon: {fileID: 21300000, guid: 86330196fca221840a59954e7d57e6fc, type: 3}
|
||||
--- !u!1 &7522310221411527342
|
||||
GameObject:
|
||||
|
|
|
|||
|
|
@ -67908,6 +67908,128 @@ MonoBehaviour:
|
|||
isOccupied: 0
|
||||
ID: 0
|
||||
instruct: {fileID: 54948035}
|
||||
--- !u!1 &674500388
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 674500389}
|
||||
- component: {fileID: 674500392}
|
||||
- component: {fileID: 674500391}
|
||||
- component: {fileID: 674500390}
|
||||
m_Layer: 0
|
||||
m_Name: "\u6D4B\u8BD5"
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &674500389
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 674500388}
|
||||
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:
|
||||
- {fileID: 1280530288}
|
||||
m_Father: {fileID: 4362348816139420719}
|
||||
m_RootOrder: 15
|
||||
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: 0, y: 407.67}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &674500390
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 674500388}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 674500391}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &674500391
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 674500388}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &674500392
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 674500388}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &674561041
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -131221,6 +131343,86 @@ MonoBehaviour:
|
|||
isOccupied: 0
|
||||
ID: 0
|
||||
instruct: {fileID: 272866451}
|
||||
--- !u!1 &1280530287
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1280530288}
|
||||
- component: {fileID: 1280530290}
|
||||
- component: {fileID: 1280530289}
|
||||
m_Layer: 0
|
||||
m_Name: Text (Legacy)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1280530288
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1280530287}
|
||||
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: 674500389}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1280530289
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1280530287}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: Button
|
||||
--- !u!222 &1280530290
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1280530287}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1280617960 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 3051758088730906312, guid: c8f09218a803c944e84c2336104ca2f9, type: 3}
|
||||
|
|
@ -184218,7 +184420,7 @@ MonoBehaviour:
|
|||
xlz_xz:
|
||||
xlz_sc:
|
||||
arguments:
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2OTM0MjMwNDIsInVzZXJuYW1lIjoiMTgzMTIzNDU2NzgifQ.quf-O03y4zo7IhX_Hb7pw7lT6RDwAd47hiSHQ7-eRPo
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2OTM1Njc2NzUsInVzZXJuYW1lIjoiMTgzMTIzNDU2NzgifQ.ePiekJGQIEfARwgrdYnoIZBlWUVcqPN5trNJb961bMI
|
||||
heatThresholdValueMax:
|
||||
heatThresholdValueMin:
|
||||
humidityThresholdValueMax:
|
||||
|
|
@ -184357,9 +184559,9 @@ MonoBehaviour:
|
|||
magnifyState: 0
|
||||
isgonging: 0
|
||||
editorMenu: {fileID: 1016767011}
|
||||
stagingPanel: {fileID: 803679558}
|
||||
objectToShow: {fileID: 6712461312143127082}
|
||||
objectToShow_add: {fileID: 1782824200}
|
||||
idleTime: 5
|
||||
--- !u!4 &1815567664
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -184418,7 +184620,7 @@ MonoBehaviour:
|
|||
isVideoPlay: 0
|
||||
isWorkPlay: 0
|
||||
gameManager: {fileID: 1815567663}
|
||||
bt: {fileID: 0}
|
||||
bt: {fileID: 674500390}
|
||||
--- !u!114 &1815567667
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -217162,6 +217364,18 @@ MonoBehaviour:
|
|||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 1016767009}
|
||||
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
|
||||
m_MethodName: SetActive
|
||||
m_Mode: 6
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
m_IsOn: 0
|
||||
--- !u!1 &1332666220962575852
|
||||
GameObject:
|
||||
|
|
@ -242594,6 +242808,18 @@ MonoBehaviour:
|
|||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 1016767009}
|
||||
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
|
||||
m_MethodName: SetActive
|
||||
m_Mode: 6
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
m_IsOn: 1
|
||||
--- !u!1 &1332666222495822969
|
||||
GameObject:
|
||||
|
|
@ -279676,6 +279902,7 @@ RectTransform:
|
|||
- {fileID: 803679559}
|
||||
- {fileID: 245605307}
|
||||
- {fileID: 1345271533}
|
||||
- {fileID: 674500389}
|
||||
m_Father: {fileID: 4362348816935953888}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
|
@ -289170,6 +289397,7 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
toggles: []
|
||||
rongLaing: {fileID: 4172065503821179884}
|
||||
xianlanpz: {fileID: 5769346755244574362}
|
||||
--- !u!1 &4362348816482923671
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -310567,6 +310795,14 @@ PrefabInstance:
|
|||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6402586138961040990, guid: c8f09218a803c944e84c2336104ca2f9, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6402586138961040991, guid: c8f09218a803c944e84c2336104ca2f9, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0.139
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: c8f09218a803c944e84c2336104ca2f9, type: 3}
|
||||
--- !u!4 &5868017143503836930 stripped
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ public class UIToCabinet : MonoBehaviour
|
|||
|
||||
public GameObject rongLaing;
|
||||
|
||||
public GameObject xianlanpz;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
|
@ -24,11 +26,14 @@ public class UIToCabinet : MonoBehaviour
|
|||
{
|
||||
GameManager.Inst.power_close();
|
||||
GameManager.Inst.objectToShow_add.SetActive(false);
|
||||
GameManager.Inst.stagingPanel.SetActive(false);
|
||||
GameManager.Inst.editorMenu.gameObject.SetActive(false);
|
||||
|
||||
rongLaing.SetActive(false);
|
||||
FloorController.Inst.FloorNormal();
|
||||
CreateLine createLine = PatternChoose.Inst.transform.Find("画线").GetComponent<CreateLine>();
|
||||
LineGroupManager.Instance.HidePanel();
|
||||
|
||||
|
||||
for (int i = 0; i < GameManager.Inst.pop_ups.Count; i++)
|
||||
{
|
||||
GameManager.Inst.pop_ups[i].SetActive(false);
|
||||
|
|
@ -41,7 +46,7 @@ public class UIToCabinet : MonoBehaviour
|
|||
{
|
||||
case "Toggle_设备告警":
|
||||
{
|
||||
StartCoroutine(Loadinfo(Menu.M_全景监控_设备告警, (x) =>
|
||||
StartCoroutine(Loadinfo(Menu.M_全景监控_设备告警, (x) =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(x)) return;
|
||||
init(Menu.M_全景监控_设备告警);
|
||||
|
|
@ -50,7 +55,7 @@ public class UIToCabinet : MonoBehaviour
|
|||
GameManager.Inst.search_box.SetActive(true);
|
||||
CabinetUIManager.ChangeMenu(Menu.M_全景监控_设备告警);
|
||||
}));
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case "Toggle_全景监控":
|
||||
|
|
@ -78,7 +83,7 @@ public class UIToCabinet : MonoBehaviour
|
|||
break;
|
||||
case "Toggle_温湿度":
|
||||
{
|
||||
StartCoroutine(Loadinfo(Menu.M_全景监控_温度, (x) =>
|
||||
StartCoroutine(Loadinfo(Menu.M_全景监控_温度, (x) =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(x)) return;
|
||||
init(Menu.M_全景监控_温度);
|
||||
|
|
@ -86,7 +91,7 @@ public class UIToCabinet : MonoBehaviour
|
|||
PatternChoose.Inst.transform.Find("Panel搜索框").GetComponent<SearchName>().LoadCabinet(SearchName.SearchType.机柜);
|
||||
GameManager.Inst.search_box.SetActive(true);
|
||||
CabinetUIManager.ChangeMenu(Menu.M_全景监控_温度);
|
||||
}));
|
||||
}));
|
||||
}
|
||||
break;
|
||||
case "Toggle_柜门状态":
|
||||
|
|
@ -176,14 +181,14 @@ public class UIToCabinet : MonoBehaviour
|
|||
break;
|
||||
case "Toggle_温度":
|
||||
{
|
||||
StartCoroutine(Loadinfo(Menu.M_全景监控_温度, (x) =>
|
||||
StartCoroutine(Loadinfo(Menu.M_全景监控_温度, (x) =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(x)) return;
|
||||
init(Menu.M_全景监控_温度);
|
||||
ExtendedFlycam.Inst.QuanJing();
|
||||
PatternChoose.Inst.transform.Find("Panel搜索框").GetComponent<SearchName>().LoadCabinet(SearchName.SearchType.机柜);
|
||||
CabinetUIManager.ChangeMenu(Menu.M_全景监控_温度);
|
||||
}));
|
||||
}));
|
||||
}
|
||||
break;
|
||||
case "Toggle_湿度":
|
||||
|
|
@ -194,7 +199,7 @@ public class UIToCabinet : MonoBehaviour
|
|||
CabinetUIManager.ChangeMenu(Menu.M_全景监控_湿度);
|
||||
}
|
||||
break;
|
||||
case "Toggle_烟感":
|
||||
case "Toggle_烟感":
|
||||
{
|
||||
init(Menu.M_全景监控_烟感);
|
||||
ExtendedFlycam.Inst.QuanJing();
|
||||
|
|
@ -206,7 +211,7 @@ public class UIToCabinet : MonoBehaviour
|
|||
{
|
||||
init(Menu.M_数字孪生_线缆连接_展示);
|
||||
ExtendedFlycam.Inst.QuanJing();
|
||||
|
||||
|
||||
//PatternChoose.Inst.transform.Find("Panel搜索框").GetComponent<SearchName>().LoadCabinet(SearchName.SearchType.线缆_展示);
|
||||
createLine.OnMenuChanged(Menu.M_数字孪生_线缆连接_展示);
|
||||
CabinetUIManager.ChangeMenu(Menu.M_数字孪生_线缆连接_展示);
|
||||
|
|
@ -232,12 +237,21 @@ public class UIToCabinet : MonoBehaviour
|
|||
break;
|
||||
}
|
||||
createLine.deletxianLan(CabinetUIManager.Instance.current_menu);
|
||||
if (toggles[index].name == "Toggle_线缆连接展示" || toggles[index].name == "Toggle_线缆连接配置" ||
|
||||
toggles[index].name == "Toggle_线缆组配置" || toggles[index].name == "Toggle_线缆链接")
|
||||
{
|
||||
xianlanpz.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
xianlanpz.SetActive(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator Loadinfo(Menu menu,Action<string> callback)
|
||||
public IEnumerator Loadinfo(Menu menu, Action<string> callback)
|
||||
{
|
||||
if (menu == Menu.M_全景监控_温度)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
http://172.16.1.68:8081/
|
||||
http://127.0.0.1:8081/
|
||||
|
|
@ -1,15 +1,13 @@
|
|||
using AutoMapper;
|
||||
using DG.Tweening;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.UI;
|
||||
using DG.Tweening;
|
||||
using static DeviceQuery;
|
||||
using static ENVQuery;
|
||||
using static PortQuery;
|
||||
|
|
@ -124,6 +122,7 @@ public class GameManager : MonoBehaviour
|
|||
public bool isgonging = false;
|
||||
|
||||
public EditorMenu editorMenu;
|
||||
public GameObject stagingPanel;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
|
@ -141,6 +140,7 @@ public class GameManager : MonoBehaviour
|
|||
|
||||
private void Start()
|
||||
{
|
||||
Debug.Log("版本号 1.1.1");
|
||||
editorMenu.editorBtn.onClick.AddListener(() =>
|
||||
{
|
||||
if (Menu.M_数字孪生_场景管理 == CabinetUIManager.Instance.current_menu && nowDevice != null)
|
||||
|
|
@ -166,7 +166,7 @@ public class GameManager : MonoBehaviour
|
|||
if (nowDevice.GetComponent<DeviceQuery>() == null) return;
|
||||
if (string.IsNullOrEmpty(nowDeviceID))
|
||||
{
|
||||
|
||||
editorMenu.gameObject.SetActive(false);
|
||||
var nub = nowDevice.GetComponent<DeviceItem>().volume;
|
||||
var _star = nowDevice.transform.parent.name;
|
||||
var star = Convert.ToInt32(_star) - 1;
|
||||
|
|
@ -184,21 +184,23 @@ public class GameManager : MonoBehaviour
|
|||
delete.mybody.ids.Add(nowDeviceID);
|
||||
StartCoroutine(delete.SaveJsonCoroutine((x) =>
|
||||
{
|
||||
|
||||
GameObject.Find("EditorMenu").SetActive(false);
|
||||
var nub = nowDevice.GetComponent<DeviceQuery>().deviceList.occupyNum;
|
||||
editorMenu.gameObject.SetActive(false);
|
||||
var nub = nowDevice.GetComponent<DragTest1>().volume;
|
||||
var _star = nowDevice.transform.parent.name;
|
||||
var star = Convert.ToInt32(_star) - 1;
|
||||
var p = nowDevice.transform.parent.parent;
|
||||
for (int i = star; i < star + Convert.ToInt32(nub); i++)
|
||||
{
|
||||
p.GetChild(i).GetComponent<UPosItem>().isOccupied = false;
|
||||
p.GetChild(i).GetComponent<UPosItem>().instruct.color = new Color(0, 1, 0, 1);
|
||||
|
||||
}
|
||||
DestroyImmediate(nowDevice);
|
||||
|
||||
}));
|
||||
}
|
||||
}
|
||||
editorMenu.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -599,7 +601,13 @@ public class GameManager : MonoBehaviour
|
|||
go.transform.position = item.transform.Find("U位/" + U).position;
|
||||
var anchorPos = go.transform.Find("锚点").gameObject;
|
||||
var collider = item.transform.Find("U位/" + U).GetComponent<Collider>();
|
||||
go.transform.position = new Vector3(anchorPos.transform.position.x, anchorPos.transform.position.y + collider.bounds.size.y / 2, anchorPos.transform.position.z);
|
||||
//go.transform.position = new Vector3(anchorPos.transform.position.x, anchorPos.transform.position.y + collider.bounds.size.y / 2, anchorPos.transform.position.z);
|
||||
var uPosition = item.transform.Find("U位/" + U).position;
|
||||
var colliderBounds = collider.bounds;
|
||||
float yOffset = colliderBounds.extents.y - colliderBounds.center.y;
|
||||
go.transform.position = new Vector3(uPosition.x, uPosition.y + colliderBounds.extents.y + yOffset, uPosition.z);
|
||||
|
||||
|
||||
//go.transform.rotation = item.transform.Find("U位/" + U).rotation;
|
||||
go.name = Racks[i].id;
|
||||
|
||||
|
|
@ -610,11 +618,11 @@ public class GameManager : MonoBehaviour
|
|||
|
||||
|
||||
go.transform.SetParent(item.transform.Find("U位/" + U));
|
||||
//go.GetComponent<DragTest>().isplace = true;
|
||||
//Array.ForEach(go.transform.GetComponentsInChildren<DragTest>(), (item) =>
|
||||
//{
|
||||
// item.enabled = false;
|
||||
//});
|
||||
//模型错误微调
|
||||
if (modelNum == "1" || modelNum == "14" || modelNum == "15" || modelNum == "83")
|
||||
{
|
||||
MoveParentAndChildren(go.transform, new Vector3(-0.25f, 0, 0));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
@ -728,19 +736,21 @@ public class GameManager : MonoBehaviour
|
|||
/// <returns></returns>
|
||||
public IEnumerator init_Device()
|
||||
{
|
||||
for (int i = 0; i < Racks_go.Count; i++)
|
||||
for (int i = Racks_go.Count - 1; i >= 0; i--)
|
||||
{
|
||||
DestroyImmediate(Racks_go[i]);
|
||||
}
|
||||
for (int i = 0; i < MachineSlots_go.Count; i++)
|
||||
//Debug.Log("@@12-1");
|
||||
for (int i = MachineSlots_go.Count - 1; i >= 0; i--)
|
||||
{
|
||||
DestroyImmediate(MachineSlots_go[i]);
|
||||
}
|
||||
for (int i = 0; i < TmsCards_go.Count; i++)
|
||||
//Debug.Log("@@12-2");
|
||||
for (int i = TmsCards_go.Count - 1; i >= 0; i--)
|
||||
{
|
||||
DestroyImmediate(TmsCards_go[i]);
|
||||
}
|
||||
|
||||
//Debug.Log("@@12-3");
|
||||
Cabinets.Clear();
|
||||
|
||||
Racks_go.Clear();
|
||||
|
|
@ -751,7 +761,7 @@ public class GameManager : MonoBehaviour
|
|||
|
||||
TmsCards_go.Clear();
|
||||
TmsCards.Clear();
|
||||
|
||||
//Debug.Log("@@12-4");
|
||||
//var jsonResult = await CombineJSON.GetJson_POST(Jk_URL.sb_cx, token);
|
||||
|
||||
//root_AllDevice = JsonConvert.DeserializeObject<DeviceQuery.Root>(jsonResult);
|
||||
|
|
@ -922,16 +932,6 @@ public class GameManager : MonoBehaviour
|
|||
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 场景模型数据初始化
|
||||
/// </summary>
|
||||
public async Task deleteInit()
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
IEnumerator LoadJSON(string url)
|
||||
|
|
@ -951,12 +951,6 @@ public class GameManager : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public void getTmsAlam()
|
||||
{
|
||||
TmsAlarmQuery.Root root = new TmsAlarmQuery.Root();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ParseJSON(string jsonString)
|
||||
{
|
||||
|
|
@ -1123,76 +1117,6 @@ public class GameManager : MonoBehaviour
|
|||
}
|
||||
}
|
||||
}
|
||||
#region MyRegion
|
||||
[ContextMenu("改位置")]
|
||||
public IEnumerator dsa()
|
||||
{
|
||||
foreach (var item in Cabinets)
|
||||
{
|
||||
RedactDevice redactDevice = new RedactDevice();
|
||||
int a = int.Parse(item.deviceCode.Split('R')[1]);
|
||||
string b = "";
|
||||
string nub = "";
|
||||
if (a <= 8) { b = "I-"; nub = (a % 8).ToString().PadLeft(2, '0'); }
|
||||
else if (a <= 16) { b = "H-"; nub = ((a - 8) % 8).ToString().PadLeft(2, '0'); }
|
||||
else if (a <= 24) { b = "G-"; nub = ((a - 16) % 8).ToString().PadLeft(2, '0'); }
|
||||
else if (a <= 32) { b = "F-"; nub = ((a - 24) % 8).ToString().PadLeft(2, '0'); }
|
||||
else if (a <= 40) { b = "E-"; nub = ((a - 32) % 8).ToString().PadLeft(2, '0'); }
|
||||
else if (a <= 48) { b = "D-"; nub = ((a - 40) % 8).ToString().PadLeft(2, '0'); }
|
||||
else if (a <= 56) { b = "C-"; nub = ((a - 48) % 8).ToString().PadLeft(2, '0'); }
|
||||
else if (a <= 64) { b = "B-"; nub = ((a - 56) % 8).ToString().PadLeft(2, '0'); }
|
||||
else if (a <= 72) { b = "A-"; nub = ((a - 64) % 8).ToString().PadLeft(2, '0'); }
|
||||
if (nub == "00") nub = "08";
|
||||
item.devicePosition = b + nub;
|
||||
|
||||
MapperConfiguration config = new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<DeviceList, RedactDevice.Body>();
|
||||
cfg.CreateMap<RedactDevice.Body, DeviceList>();
|
||||
});
|
||||
|
||||
IMapper mapper = config.CreateMapper();
|
||||
var objB = mapper.Map<RedactDevice.Body>(item);
|
||||
//redactDevice.mybody = ObjectConverter.Convert<DeviceList, RedactDevice.Body>(item);
|
||||
redactDevice.mybody = objB;
|
||||
yield return StartCoroutine(redactDevice.saveJson());
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
//await Task.Delay(500); // 等待5秒钟
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static class ObjectConverter
|
||||
{
|
||||
public static TTarget Convert<TSource, TTarget>(TSource source)
|
||||
{
|
||||
Type targetType = typeof(TTarget);
|
||||
Type sourceType = typeof(TSource);
|
||||
|
||||
PropertyInfo[] targetProperties = targetType.GetProperties();
|
||||
PropertyInfo[] sourceProperties = sourceType.GetProperties();
|
||||
|
||||
var targetInstance = Activator.CreateInstance(targetType);
|
||||
|
||||
foreach (var targetProperty in targetProperties)
|
||||
{
|
||||
var sourceProperty = Array.Find(sourceProperties, p => p.Name == targetProperty.Name);
|
||||
|
||||
if (sourceProperty != null && sourceProperty.PropertyType == targetProperty.PropertyType)
|
||||
{
|
||||
var value = sourceProperty.GetValue(source);
|
||||
var targetSetMethod = targetProperty.GetSetMethod();
|
||||
|
||||
if (targetSetMethod != null)
|
||||
{
|
||||
targetSetMethod.Invoke(targetInstance, new object[] { value });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (TTarget)targetInstance;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示机柜容量
|
||||
|
|
@ -1355,66 +1279,6 @@ public class GameManager : MonoBehaviour
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示柜门状态
|
||||
/// </summary>
|
||||
[ContextMenu("显示柜门状态")]
|
||||
public void DoorCondition(Toggle t)
|
||||
{
|
||||
if (!t.isOn)
|
||||
{
|
||||
for (int i = 0; i < Cabinets_go.Count; i++)
|
||||
{
|
||||
var door = Array.Find(Cabinets_go[i].transform.GetComponentsInChildren<Renderer>(), item =>
|
||||
{
|
||||
return item.name.Contains("Object");
|
||||
});
|
||||
if (door)
|
||||
door.transform.localRotation = Quaternion.Euler(Vector3.zero);
|
||||
}
|
||||
CloseHighlight();
|
||||
return;
|
||||
}
|
||||
CloseHighlight();
|
||||
Color c = new Color(108f / 255, 221f / 255, 239f / 255, 1);
|
||||
for (int i = 0; i < Cabinets_go.Count; i++)
|
||||
{
|
||||
var D = Cabinets_go[i].GetComponent<DeviceQuery>().deviceList;
|
||||
var hight = Cabinets_go[i].transform.Find("高亮").gameObject;
|
||||
//var H = Cabinets_go[i].GetComponent<HighlightEffect>();
|
||||
if (string.IsNullOrEmpty(D.openFlag)) continue;
|
||||
else if (D.openFlag == "0")
|
||||
{
|
||||
//关
|
||||
hight.SetActive(false);
|
||||
}
|
||||
else if (D.openFlag == "1")
|
||||
{
|
||||
//开
|
||||
GameObject go;
|
||||
try
|
||||
{
|
||||
go = Cabinets_go[i].transform.Find(Cabinets_go[i].name).gameObject;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
go = Cabinets_go[i];
|
||||
}
|
||||
if (go)
|
||||
{
|
||||
//ChangeMaterialColor(go, 0, c);
|
||||
hight.SetActive(true);
|
||||
hight.GetComponent<Renderer>().material = Resources.Load<Material>("Materials/3Tou");
|
||||
}
|
||||
var door = Array.Find(Cabinets_go[i].transform.GetComponentsInChildren<Renderer>(), item =>
|
||||
{
|
||||
return item.name.Contains("Object");
|
||||
});
|
||||
if (door)
|
||||
door.transform.localRotation = Quaternion.Euler(Vector3.forward * -90);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示柜门状态
|
||||
|
|
@ -1468,11 +1332,15 @@ public class GameManager : MonoBehaviour
|
|||
{
|
||||
if (D.backDoorFlag == "0")
|
||||
{
|
||||
//模型原因微调
|
||||
if (Cabinets_go[i].name == "R72") return;
|
||||
//关
|
||||
power_close(Cabinets_go[i], "后门");
|
||||
}
|
||||
else if (D.backDoorFlag == "1")
|
||||
{
|
||||
//模型原因微调
|
||||
if (Cabinets_go[i].name == "R72") return;
|
||||
//开
|
||||
GameObject go = null;
|
||||
try
|
||||
|
|
@ -1521,6 +1389,12 @@ public class GameManager : MonoBehaviour
|
|||
Cabinets_go[i].transform.GetChild(2).DOLocalRotate(Vector3.zero, 2);
|
||||
Cabinets_go[i].transform.GetChild(3).DOLocalRotate(Vector3.zero, 2);
|
||||
}
|
||||
//模型原因微调
|
||||
else if (Cabinets_go[i].name == "R72")
|
||||
{
|
||||
Cabinets_go[i].transform.GetChild(0).DOLocalRotate(Vector3.zero, 2);
|
||||
Cabinets_go[i].transform.GetChild(1).DOLocalRotate(Vector3.forward * -180, 2);
|
||||
}
|
||||
else /*if (door.Length == 2)*/
|
||||
{
|
||||
//door.transform.localRotation = Quaternion.Euler(Vector3.zero);
|
||||
|
|
@ -1552,6 +1426,13 @@ public class GameManager : MonoBehaviour
|
|||
Cabinets_go[i].transform.GetChild(0).DOLocalRotate(Vector3.forward * -90, 2f);
|
||||
Cabinets_go[i].transform.GetChild(1).DOLocalRotate(Vector3.forward * 90, 2f);
|
||||
}
|
||||
//模型原因微调
|
||||
else if (Cabinets_go[i].name == "R72")
|
||||
{
|
||||
Cabinets_go[i].transform.GetChild(0).DOLocalRotate(Vector3.forward * -90, 2f);
|
||||
Cabinets_go[i].transform.GetChild(1).DOLocalRotate(Vector3.forward * 90, 2f);
|
||||
|
||||
}
|
||||
else /*if (door.Length == 2)*/
|
||||
{
|
||||
//door.transform.localRotation = Quaternion.Euler(Vector3.forward * -90);
|
||||
|
|
@ -1593,6 +1474,12 @@ public class GameManager : MonoBehaviour
|
|||
cabinet.transform.GetChild(2).DOLocalRotate(Vector3.forward * -90, 2f);
|
||||
cabinet.transform.GetChild(3).DOLocalRotate(Vector3.forward * 90, 2f);
|
||||
}
|
||||
//模型原因微调
|
||||
else if (cabinet.name == "R72")
|
||||
{
|
||||
cabinet.transform.GetChild(1).DOLocalRotate(Vector3.forward * 90, 2f);
|
||||
|
||||
}
|
||||
else /*if (door.Length == 2)*/
|
||||
//door.transform.localRotation = Quaternion.Euler(Vector3.forward * -90);
|
||||
cabinet.transform.GetChild(1).DOLocalRotate(Vector3.forward * -90, 2f);
|
||||
|
|
@ -1646,6 +1533,11 @@ public class GameManager : MonoBehaviour
|
|||
cabinet.transform.GetChild(2).DOLocalRotate(Vector3.zero, 2);
|
||||
cabinet.transform.GetChild(3).DOLocalRotate(Vector3.zero, 2);
|
||||
}
|
||||
//模型原因微调
|
||||
else if (cabinet.name == "R72")
|
||||
{
|
||||
cabinet.transform.GetChild(1).DOLocalRotate(Vector3.forward * -180, 2);
|
||||
}
|
||||
else /*if (door.Length == 2)*/
|
||||
cabinet.transform.GetChild(1).DOLocalRotate(Vector3.zero, 2);
|
||||
}
|
||||
|
|
@ -1658,6 +1550,12 @@ public class GameManager : MonoBehaviour
|
|||
cabinet.transform.GetChild(2).DOLocalRotate(Vector3.zero, 2);
|
||||
cabinet.transform.GetChild(3).DOLocalRotate(Vector3.zero, 2);
|
||||
}
|
||||
//模型原因微调
|
||||
else if (cabinet.name == "R72")
|
||||
{
|
||||
cabinet.transform.GetChild(0).DOLocalRotate(Vector3.zero, 2);
|
||||
cabinet.transform.GetChild(1).DOLocalRotate(Vector3.forward * -180, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
cabinet.transform.GetChild(0).DOLocalRotate(Vector3.zero, 2);
|
||||
|
|
@ -1730,7 +1628,6 @@ public class GameManager : MonoBehaviour
|
|||
|
||||
private void OnDisable()
|
||||
{
|
||||
StopTimer();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
|
@ -1765,53 +1662,13 @@ public class GameManager : MonoBehaviour
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Header("--------------------------------")]
|
||||
[Header("-------------- 搜索框------------------")]
|
||||
public GameObject objectToShow;
|
||||
|
||||
public GameObject objectToShow_add;
|
||||
public float idleTime = 5f; // 空闲时间阈值,单位为秒
|
||||
[HideInInspector] public Coroutine timerCoroutine;
|
||||
public void StartTimer()
|
||||
{
|
||||
// 开始计时器
|
||||
timerCoroutine = StartCoroutine(ShowObjectAfterIdleTime());
|
||||
}
|
||||
|
||||
private void StopTimer()
|
||||
{
|
||||
// 停止计时器
|
||||
if (timerCoroutine != null)
|
||||
{
|
||||
StopCoroutine(timerCoroutine);
|
||||
timerCoroutine = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void StopTimer(Toggle t)
|
||||
{
|
||||
// 停止计时器
|
||||
if (timerCoroutine != null && !t.isOn)
|
||||
{
|
||||
StopCoroutine(timerCoroutine);
|
||||
timerCoroutine = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetTimer()
|
||||
{
|
||||
// 重置计时器
|
||||
StopTimer();
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
public IEnumerator ShowObjectAfterIdleTime()
|
||||
{
|
||||
// 等待一段时间
|
||||
yield return new WaitForSeconds(idleTime);
|
||||
|
||||
// 显示物体
|
||||
objectToShow.SetActive(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 递增寻找父物体
|
||||
|
|
@ -1823,6 +1680,8 @@ public class GameManager : MonoBehaviour
|
|||
{
|
||||
if (gameObject == null)
|
||||
return null;
|
||||
if (condition(gameObject))
|
||||
return gameObject;
|
||||
Transform parent = gameObject.transform.parent;
|
||||
while (parent != null)
|
||||
{
|
||||
|
|
@ -1844,8 +1703,6 @@ public class GameManager : MonoBehaviour
|
|||
/// <returns></returns>
|
||||
public bool IsDesiredParent(GameObject go)
|
||||
{
|
||||
// 在此处添加自定义条件
|
||||
// 例如:判断是否具有特定组件、特定标签等
|
||||
DeviceQuery d = go.GetComponent<DeviceQuery>();
|
||||
return (d != null && d.deviceList.type == "1");
|
||||
}
|
||||
|
|
@ -1886,25 +1743,26 @@ public class GameManager : MonoBehaviour
|
|||
// 获取接口信息
|
||||
public IEnumerator Initialize(Action<string> callback = null)
|
||||
{
|
||||
//Debug.Log("@@10");
|
||||
isLoading = false;
|
||||
|
||||
//Debug.Log("@@11");
|
||||
TransparentGlowManage.Inst.addScript();
|
||||
|
||||
//Debug.Log("@@12");
|
||||
yield return StartCoroutine(init_Device());
|
||||
|
||||
//Debug.Log("@@13");//???
|
||||
yield return StartCoroutine(init_Port());
|
||||
|
||||
//Debug.Log("@@14");
|
||||
//yield return StartCoroutine(init_TmsAlarm());
|
||||
|
||||
//yield return StartCoroutine(init_ENV());
|
||||
|
||||
yield return StartCoroutine(LineQuery.Inst.getJsonCoroutine());
|
||||
|
||||
//Debug.Log("@@15");
|
||||
LoadScene();
|
||||
}
|
||||
|
||||
// 加载场景
|
||||
private void LoadScene()
|
||||
public void LoadScene()
|
||||
{
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
{
|
||||
|
|
@ -1928,9 +1786,24 @@ public class GameManager : MonoBehaviour
|
|||
TmsPorts_go[i].GetComponent<PortQuery>().hight.SetActive(true);
|
||||
}
|
||||
}
|
||||
//Debug.Log("@@16");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 微调模型移动
|
||||
/// </summary>
|
||||
public void MoveParentAndChildren(Transform parentTransform, Vector3 moveDistance)
|
||||
{
|
||||
// 移动父物体
|
||||
parentTransform.position += moveDistance;
|
||||
|
||||
// 移动所有子物体
|
||||
foreach (Transform childTransform in parentTransform)
|
||||
{
|
||||
childTransform.position += moveDistance;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -35,11 +35,13 @@ public class WebInteraction : MonoBehaviour
|
|||
|
||||
private void Start()
|
||||
{
|
||||
//bt.onClick.AddListener(() =>
|
||||
//{
|
||||
// gameManager.token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2OTI2NDMyODksInVzZXJuYW1lIjoiMTgzMTIzNDU2NzgifQ.uMoC7I4SytLEgYTKHxyvOv7Lygeb9zDCmhLDYv1cJrA";
|
||||
// gameManager.enabled = true;
|
||||
//});
|
||||
bt.onClick.AddListener(() =>
|
||||
{
|
||||
//gameManager.token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2OTI2NDMyODksInVzZXJuYW1lIjoiMTgzMTIzNDU2NzgifQ.uMoC7I4SytLEgYTKHxyvOv7Lygeb9zDCmhLDYv1cJrA";
|
||||
//gameManager.enabled = true;
|
||||
Debug.Log("&&&");
|
||||
unity_ticket_cabinet("1691457954939693001,1691457954939693002,1691457954939693003,1691457954939693004,1691457954939693005,1691457954939693006,1691457954939693007,1691457954939693008,1691457954939693009,1691457954939693010,1691457954939693011,1691457954939693012");
|
||||
});
|
||||
}
|
||||
|
||||
//前端调用Unity 方法逻辑
|
||||
|
|
@ -159,6 +161,7 @@ public class WebInteraction : MonoBehaviour
|
|||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 发送视频监控坐标的函数
|
||||
/// </summary>
|
||||
|
|
@ -202,6 +205,7 @@ public class WebInteraction : MonoBehaviour
|
|||
// 在此处处理打开现场作业的逻辑
|
||||
Debug.Log("Opening ticket");
|
||||
Application.ExternalCall("web_ticket_open", "");
|
||||
unity_ticket_cabinet("1691457954939693001,1691457954939693002");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -212,77 +216,91 @@ public class WebInteraction : MonoBehaviour
|
|||
// 在此处处理关闭现场作业的逻辑
|
||||
Debug.Log("Closing ticket");
|
||||
Application.ExternalCall("web_ticket_close", "");
|
||||
|
||||
foreach (var item in GameManager.Inst.Cabinets_go)
|
||||
{
|
||||
item.transform.Find("高亮").gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
[ContextMenu("工作票设备关联的函数")]
|
||||
/// <summary>
|
||||
/// 工作票设备关联的函数
|
||||
/// </summary>
|
||||
/// <param name="deviceNumbers"></param>
|
||||
public void unity_ticket_cabinet(string deviceNumbers)
|
||||
{
|
||||
//,
|
||||
Array.ForEach(deviceNumbers.Split(','), (device) =>
|
||||
{
|
||||
GameObject go = null;
|
||||
List<GameObject> ls = new List<GameObject>();
|
||||
ls.AddRange(GameManager.Inst.Cabinets_go);
|
||||
ls.AddRange(GameManager.Inst.Racks_go);
|
||||
ls.AddRange(GameManager.Inst.MachineSlots_go);
|
||||
ls.AddRange(GameManager.Inst.TmsCards_go);
|
||||
go = Array.Find(ls.ToArray(), item =>
|
||||
{
|
||||
return (item.GetComponent<DeviceQuery>().deviceList.id == device);
|
||||
});
|
||||
if (go != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
//var c = go.GetComponent<Renderer>().materials[0].color;
|
||||
//GameManager.Inst.ChangeMaterialColor(go, 0, new Color(1, 109f / 255, 0, 1));
|
||||
//DOVirtual.Float(0, 10, 1f, null).OnComplete(() => GameManager.Inst.ChangeMaterialColor(go, 0, c));
|
||||
|
||||
var Cabinet = gameManager.FindParent(go, gameManager.IsDesiredParent);
|
||||
var devices = deviceNumbers.Split(',');
|
||||
List<GameObject> ls = new List<GameObject>();
|
||||
ls.AddRange(GameManager.Inst.Cabinets_go);
|
||||
ls.AddRange(GameManager.Inst.Racks_go);
|
||||
|
||||
for (int i = 0; i < ls.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < devices.Length; j++)
|
||||
{
|
||||
if (devices[j] == ls[i].GetComponent<DeviceQuery>().deviceList.id)
|
||||
{
|
||||
var Cabinet = gameManager.FindParent(ls[i].gameObject, gameManager.IsDesiredParent);
|
||||
if (Cabinet)
|
||||
{
|
||||
var hight = Cabinet.transform.Find("高亮").gameObject;
|
||||
hight.SetActive(true);
|
||||
hight.GetComponent<Renderer>().material = Resources.Load<Material>("Materials/1Tou");
|
||||
|
||||
changC(hight, "1");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Log(e.Message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class BoolMonitor
|
||||
public void changC(GameObject hight, string index)
|
||||
{
|
||||
private static bool _value = false;
|
||||
/// <summary>
|
||||
/// ¾µÍ·ÊÇ·ñΪ²»¶¯×´Ì¬
|
||||
/// </summary>
|
||||
public static bool Value
|
||||
{
|
||||
get { return _value; }
|
||||
set
|
||||
{
|
||||
if (_value != value)
|
||||
{
|
||||
_value = value;
|
||||
OnValueChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
hight.SetActive(true);
|
||||
|
||||
public static event EventHandler ValueChanged;
|
||||
Renderer renderer = hight.GetComponent<Renderer>();
|
||||
|
||||
|
||||
Material[] sharedMaterials = renderer.sharedMaterials;
|
||||
|
||||
//for (int i = 0; i < sharedMaterials.Length; i++)
|
||||
//{
|
||||
// sharedMaterials[i] = newMaterial;
|
||||
//}
|
||||
|
||||
sharedMaterials[0] = Resources.Load<Material>("Materials/" + index + "Tou");
|
||||
|
||||
renderer.sharedMaterials = sharedMaterials;
|
||||
|
||||
static void OnValueChanged()
|
||||
{
|
||||
ValueChanged?.Invoke(null, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class BoolMonitor
|
||||
{
|
||||
private static bool _value = false;
|
||||
/// <summary>
|
||||
/// 镜头是否为不动状态
|
||||
/// </summary>
|
||||
public static bool Value
|
||||
{
|
||||
get { return _value; }
|
||||
set
|
||||
{
|
||||
if (_value != value)
|
||||
{
|
||||
_value = value;
|
||||
OnValueChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static event EventHandler ValueChanged;
|
||||
|
||||
static void OnValueChanged()
|
||||
{
|
||||
ValueChanged?.Invoke(null, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,13 +54,13 @@ public class AlarmUI : MonoBehaviour, IPointerClickHandler
|
|||
}
|
||||
canvas.gameObject.SetActive(true);
|
||||
|
||||
// 获取Canvas上的RectTransform组件
|
||||
|
||||
RectTransform canvasRectTransform = canvas.GetComponent<RectTransform>();
|
||||
|
||||
// 世界坐标转屏幕坐标
|
||||
|
||||
Vector3 screenPos = Camera.main.WorldToScreenPoint(worldPosition);
|
||||
|
||||
// 屏幕坐标转Overlay坐标
|
||||
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRectTransform, screenPos, canvas.worldCamera, out Vector2 overlayPos);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -47,18 +47,18 @@ public class AddDevice : MonoBehaviour
|
|||
/// </summary>
|
||||
public Dropdown status;
|
||||
|
||||
MapperConfiguration config;
|
||||
IMapper mapper;
|
||||
DeviceQuery.DeviceList deviceList;
|
||||
//MapperConfiguration config;
|
||||
//IMapper mapper;
|
||||
DeviceQuery.DeviceList device;
|
||||
private void OnEnable()
|
||||
{
|
||||
init();
|
||||
config = new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<AddDevice.Body, DeviceQuery.DeviceList>();
|
||||
cfg.CreateMap<DeviceQuery.DeviceList, AddDevice.Body>();
|
||||
});
|
||||
mapper = config.CreateMapper();
|
||||
//config = new MapperConfiguration(cfg =>
|
||||
//{
|
||||
// cfg.CreateMap<AddDevice.Body, DeviceQuery.DeviceList>();
|
||||
// cfg.CreateMap<DeviceQuery.DeviceList, AddDevice.Body>();
|
||||
//});
|
||||
//mapper = config.CreateMapper();
|
||||
try
|
||||
{
|
||||
if (GameManager.Inst.nowDevice.GetComponent<DeviceQuery>().deviceList.deviceType != "1")
|
||||
|
|
@ -69,16 +69,18 @@ public class AddDevice : MonoBehaviour
|
|||
{
|
||||
if (GameManager.Inst.TmsPorts[i].id == GameManager.Inst.nowDeviceID)
|
||||
{
|
||||
deviceList = GameManager.Inst.root_AllDevice.data[i];
|
||||
device = GameManager.Inst.root_AllDevice.data[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (deviceList != null)
|
||||
mybody = mapper.Map<AddDevice.Body>(deviceList);
|
||||
if (device != null)
|
||||
{
|
||||
//mybody = mapper.Map<AddDevice.Body>(deviceList);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mybody = mapper.Map<AddDevice.Body>(GameManager.Inst.nowDevice.GetComponent<DeviceQuery>().deviceList);
|
||||
//mybody = mapper.Map<AddDevice.Body>(GameManager.Inst.nowDevice.GetComponent<DeviceQuery>().deviceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -143,6 +145,8 @@ public class AddDevice : MonoBehaviour
|
|||
|
||||
save_bt.onClick.AddListener(() =>
|
||||
{
|
||||
GameManager.Inst.editorMenu.gameObject.SetActive(false);
|
||||
|
||||
StartCoroutine(SaveJsonCoroutine());
|
||||
});
|
||||
}
|
||||
|
|
@ -153,24 +157,49 @@ public class AddDevice : MonoBehaviour
|
|||
{
|
||||
if (URlreturn != null && URlreturn.message == "操作成功")
|
||||
{
|
||||
StartCoroutine(Succeed());
|
||||
GameManager.Inst.lastDeviceID = URlreturn.data;
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
//StartCoroutine(Succeed());
|
||||
|
||||
StartCoroutine(Succeed((x) =>
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
GameManager.Inst.objectToShow_add.gameObject.SetActive(true);
|
||||
if (x)
|
||||
{
|
||||
DestroyImmediate(GameManager.Inst.nowDevice);
|
||||
GameManager.Inst.lastDeviceID = URlreturn.data;
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
GameManager.Inst.objectToShow_add.gameObject.SetActive(true);
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
|
||||
public IEnumerator Succeed()
|
||||
public IEnumerator Succeed(Action<bool> callback)
|
||||
{
|
||||
yield return StartCoroutine(GameManager.Inst.Initialize());
|
||||
Array.ForEach(GameObject.FindObjectsOfType<UPosItem>(), (item) =>
|
||||
{
|
||||
item.isOccupied = false;
|
||||
});
|
||||
GameManager.Inst.isLoading = false;
|
||||
|
||||
TransparentGlowManage.Inst.addScript();
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Device());
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Port());
|
||||
|
||||
|
||||
yield return StartCoroutine(LineQuery.Inst.getJsonCoroutine());
|
||||
|
||||
GameManager.Inst.LoadScene();
|
||||
callback.Invoke(true);
|
||||
}
|
||||
|
||||
|
||||
private void slotId_fuc(int arg0)
|
||||
{
|
||||
//办卡
|
||||
|
|
@ -220,6 +249,16 @@ public class AddDevice : MonoBehaviour
|
|||
//if (type.value == 0 || deviceType.value == 0 || status.value == 2) yield break;
|
||||
try
|
||||
{
|
||||
DragTest1 d = new DragTest1();
|
||||
if (GameManager.Inst.nowDevice.GetComponent<DeviceQuery>())
|
||||
{
|
||||
d = GameManager.Inst.nowDevice.GetComponent<DragTest1>();
|
||||
mybody.occupyNum = d.volume.ToString();
|
||||
mybody.modelNum = d.name.Replace("(Clone)", "");
|
||||
mybody.devicePosition = d.transform.parent.name;
|
||||
}
|
||||
|
||||
|
||||
mybody.type = type.value.ToString();
|
||||
|
||||
mybody.deviceType = deviceType.value.ToString();
|
||||
|
|
|
|||
|
|
@ -41,18 +41,18 @@ public class AddPort : MonoBehaviour
|
|||
|
||||
public Dropdown cableGroupName;
|
||||
|
||||
MapperConfiguration config;
|
||||
IMapper mapper;
|
||||
//MapperConfiguration config;
|
||||
//IMapper mapper;
|
||||
PortQuery.PortList portlist;
|
||||
private void OnEnable()
|
||||
{
|
||||
init();
|
||||
config = new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<AddPort.Body, PortQuery.PortList>();
|
||||
cfg.CreateMap<PortQuery.PortList, AddPort.Body>();
|
||||
});
|
||||
mapper = config.CreateMapper();
|
||||
//config = new MapperConfiguration(cfg =>
|
||||
//{
|
||||
// cfg.CreateMap<AddPort.Body, PortQuery.PortList>();
|
||||
// cfg.CreateMap<PortQuery.PortList, AddPort.Body>();
|
||||
//});
|
||||
//mapper = config.CreateMapper();
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(GameManager.Inst.nowDeviceID))
|
||||
|
|
@ -66,12 +66,15 @@ public class AddPort : MonoBehaviour
|
|||
}
|
||||
}
|
||||
if (portlist != null)
|
||||
mybody = mapper.Map<AddPort.Body>(portlist);
|
||||
}
|
||||
else
|
||||
{
|
||||
mybody = mapper.Map<AddPort.Body>(GameManager.Inst.nowDevice.GetComponent<PortQuery>().portList);
|
||||
{
|
||||
// mybody = mapper.Map<AddPort.Body>(portlist);
|
||||
}
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// mybody = mapper.Map<AddPort.Body>(GameManager.Inst.nowDevice.GetComponent<PortQuery>().portList);
|
||||
//}
|
||||
mybody.deviceId = transform.parent.GetComponent<DeviceQuery>().deviceList.id;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
@ -105,7 +108,7 @@ public class AddPort : MonoBehaviour
|
|||
//deviceId.options.Clear();
|
||||
List<string> deviceId_ops = new List<string>();
|
||||
deviceId_ops.Add("");
|
||||
|
||||
|
||||
var list = Array.FindAll(GameObject.FindObjectsOfType<PortQuery>(), itme =>
|
||||
{
|
||||
var n = itme.transform.parent.GetComponent<DeviceQuery>().deviceList;
|
||||
|
|
@ -137,22 +140,35 @@ public class AddPort : MonoBehaviour
|
|||
conDevice.onValueChanged.AddListener(conDevice_fuc);//对联设备
|
||||
save_bt.onClick.AddListener(() =>
|
||||
{
|
||||
GameManager.Inst.editorMenu.gameObject.SetActive(false);
|
||||
|
||||
StartCoroutine(SaveJsonCoroutine());
|
||||
});
|
||||
}
|
||||
|
||||
private IEnumerator SaveJsonCoroutine()
|
||||
{
|
||||
yield return StartCoroutine(saveJson());
|
||||
yield return StartCoroutine(saveJson((x) =>
|
||||
{
|
||||
gameObject.SetActive(x);
|
||||
return;
|
||||
}));
|
||||
|
||||
if (URlreturn != null && URlreturn.message == "操作成功")
|
||||
{
|
||||
yield return StartCoroutine(Succeed());
|
||||
GameManager.Inst.lastDeviceID = URlreturn.data;
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
|
||||
StartCoroutine(Succeed((x) =>
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
if (x)
|
||||
{
|
||||
GameManager.Inst.lastDeviceID = URlreturn.data;
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -160,9 +176,21 @@ public class AddPort : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public IEnumerator Succeed()
|
||||
public IEnumerator Succeed(Action<bool> callback)
|
||||
{
|
||||
yield return StartCoroutine(GameManager.Inst.Initialize());
|
||||
GameManager.Inst.isLoading = false;
|
||||
|
||||
TransparentGlowManage.Inst.addScript();
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Device());
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Port());
|
||||
|
||||
|
||||
yield return StartCoroutine(LineQuery.Inst.getJsonCoroutine());
|
||||
|
||||
GameManager.Inst.LoadScene();
|
||||
callback.Invoke(true);
|
||||
}
|
||||
|
||||
private void conDevice_fuc(int arg0)
|
||||
|
|
@ -199,8 +227,13 @@ public class AddPort : MonoBehaviour
|
|||
|
||||
}
|
||||
|
||||
public IEnumerator saveJson()
|
||||
public IEnumerator saveJson(Action<bool> callback = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(mybody.deviceId))
|
||||
{
|
||||
callback?.Invoke(false);
|
||||
yield break;
|
||||
}
|
||||
try
|
||||
{
|
||||
mybody.port = port.text;
|
||||
|
|
|
|||
|
|
@ -14,34 +14,56 @@ public class DeleteDevice : MonoBehaviour
|
|||
|
||||
|
||||
|
||||
public IEnumerator SaveJsonCoroutine(Action<string> callback = null)
|
||||
public IEnumerator SaveJsonCoroutine(Action<bool> callback = null)
|
||||
{
|
||||
yield return StartCoroutine(saveJson());
|
||||
|
||||
if (URlreturn != null && URlreturn.message == "操作成功")
|
||||
yield return StartCoroutine(saveJson((w)=>
|
||||
{
|
||||
yield return StartCoroutine(Succeed());
|
||||
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
if (URlreturn != null && URlreturn.message == "操作成功")
|
||||
{
|
||||
callback?.Invoke(true);
|
||||
StartCoroutine(Succeed((x) =>
|
||||
{
|
||||
if (x)
|
||||
{
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
GameManager.Inst.objectToShow_add.gameObject.SetActive(true);
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
GameManager.Inst.objectToShow_add.gameObject.SetActive(true);
|
||||
callback?.Invoke("1");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public IEnumerator Succeed()
|
||||
public IEnumerator Succeed(Action<bool> callback)
|
||||
{
|
||||
yield return StartCoroutine(GameManager.Inst.Initialize());
|
||||
Array.ForEach(GameObject.FindObjectsOfType<UPosItem>(), (item) =>
|
||||
{
|
||||
item.isOccupied = false;
|
||||
});
|
||||
|
||||
GameManager.Inst.isLoading = false;
|
||||
|
||||
TransparentGlowManage.Inst.addScript();
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Device());
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Port());
|
||||
|
||||
|
||||
yield return StartCoroutine(LineQuery.Inst.getJsonCoroutine());
|
||||
|
||||
GameManager.Inst.LoadScene();
|
||||
callback.Invoke(true);
|
||||
}
|
||||
|
||||
|
||||
public IEnumerator saveJson(Action<string> callback=null)
|
||||
public IEnumerator saveJson(Action<Root> callback=null)
|
||||
{
|
||||
var newData = JsonConvert.SerializeObject(mybody);
|
||||
|
||||
|
|
@ -55,10 +77,11 @@ public class DeleteDevice : MonoBehaviour
|
|||
try
|
||||
{
|
||||
URlreturn = JsonConvert.DeserializeObject<Root>(jsonResult);
|
||||
callback?.Invoke("1");
|
||||
callback?.Invoke(URlreturn);
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
callback?.Invoke(null);
|
||||
Debug.Log("删除设备错误:" + e.Message);
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -19,12 +19,16 @@ public class DeletePort : MonoBehaviour
|
|||
|
||||
if (URlreturn != null && URlreturn.message == "操作成功")
|
||||
{
|
||||
yield return StartCoroutine(Succeed());
|
||||
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
yield return StartCoroutine(Succeed((x)=>
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
if (x)
|
||||
{
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -35,9 +39,25 @@ public class DeletePort : MonoBehaviour
|
|||
|
||||
|
||||
|
||||
public IEnumerator Succeed()
|
||||
public IEnumerator Succeed(Action<bool> callback)
|
||||
{
|
||||
yield return StartCoroutine(GameManager.Inst.Initialize());
|
||||
Array.ForEach(GameObject.FindObjectsOfType<UPosItem>(), (item) =>
|
||||
{
|
||||
item.isOccupied = false;
|
||||
});
|
||||
GameManager.Inst.isLoading = false;
|
||||
|
||||
TransparentGlowManage.Inst.addScript();
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Device());
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Port());
|
||||
|
||||
|
||||
yield return StartCoroutine(LineQuery.Inst.getJsonCoroutine());
|
||||
|
||||
GameManager.Inst.LoadScene();
|
||||
callback.Invoke(true);
|
||||
}
|
||||
|
||||
public IEnumerator saveJson()
|
||||
|
|
|
|||
|
|
@ -42,16 +42,17 @@ public class RedactDevice : MonoBehaviour
|
|||
|
||||
|
||||
|
||||
MapperConfiguration config;
|
||||
IMapper mapper;
|
||||
//MapperConfiguration config;
|
||||
//IMapper mapper;
|
||||
public void OnEnable()
|
||||
{
|
||||
config = new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<RedactDevice.Body, DeviceQuery.DeviceList>();
|
||||
cfg.CreateMap<DeviceQuery.DeviceList, RedactDevice.Body>();
|
||||
});
|
||||
mapper = config.CreateMapper();
|
||||
mybody = new Body();
|
||||
//config = new MapperConfiguration(cfg =>
|
||||
//{
|
||||
// cfg.CreateMap<RedactDevice.Body, DeviceQuery.DeviceList>();
|
||||
// cfg.CreateMap<DeviceQuery.DeviceList, RedactDevice.Body>();
|
||||
//});
|
||||
//mapper = config.CreateMapper();
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(GameManager.Inst.nowDeviceID))
|
||||
|
|
@ -64,7 +65,51 @@ public class RedactDevice : MonoBehaviour
|
|||
break;
|
||||
}
|
||||
}
|
||||
mybody = mapper.Map<RedactDevice.Body>(device);
|
||||
//mybody = mapper.Map<RedactDevice.Body>(device);
|
||||
if (device != null)
|
||||
{
|
||||
mybody.id = device.id;
|
||||
mybody.deviceName = device.deviceName;
|
||||
mybody.deviceCode = device.deviceCode;
|
||||
mybody.type = device.type;
|
||||
mybody.typeStr = device.typeStr;
|
||||
mybody.deviceType = device.deviceType;
|
||||
mybody.deviceTypeStr = device.deviceTypeStr;
|
||||
mybody.rackId = device.rackId;
|
||||
mybody.shelfId = device.shelfId;
|
||||
mybody.slotId = device.slotId;
|
||||
mybody.devicePosition = device.devicePosition;
|
||||
mybody.machineModel = device.machineModel;
|
||||
mybody.status = device.status;
|
||||
mybody.conDeviceName = device.conDeviceName;
|
||||
mybody.rackType = device.rackType;
|
||||
mybody.openFlag = device.openFlag;
|
||||
mybody.backDoorFlag = device.backDoorFlag;
|
||||
mybody.modelNum = device.modelNum;
|
||||
mybody.occupyNum = device.occupyNum;
|
||||
mybody.residueNum = device.residueNum;
|
||||
mybody.operationTime = device.operationTime;
|
||||
mybody.directorName = device.directorName;
|
||||
mybody.phone = device.phone;
|
||||
mybody.manufacturer = device.manufacturer;
|
||||
mybody.powerProperties = device.powerProperties;
|
||||
mybody.maintenanceUnit = device.maintenanceUnit;
|
||||
mybody.machineFrameHigh = device.machineFrameHigh;
|
||||
mybody.machineFrameWide = device.machineFrameWide;
|
||||
mybody.machineFrameThick = device.machineFrameThick;
|
||||
mybody.slotNum = device.slotNum;
|
||||
mybody.slotSort = device.slotSort;
|
||||
mybody.installMethod = device.installMethod;
|
||||
mybody.affiliationFrame = device.affiliationFrame;
|
||||
mybody.parentSlotName = device.parentSlotName;
|
||||
mybody.slotType = device.slotType;
|
||||
mybody.occupyStatus = device.occupyStatus;
|
||||
mybody.affiliationSlot = device.affiliationSlot;
|
||||
mybody.portNum = device.portNum;
|
||||
mybody.cardFunction = device.cardFunction;
|
||||
mybody.cardType = device.cardType;
|
||||
mybody.runStatus = device.runStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
@ -96,6 +141,7 @@ public class RedactDevice : MonoBehaviour
|
|||
{
|
||||
save_bt.onClick.AddListener(() =>
|
||||
{
|
||||
GameManager.Inst.editorMenu.gameObject.SetActive(false);
|
||||
StartCoroutine(SaveJsonCoroutine());
|
||||
});
|
||||
}
|
||||
|
|
@ -105,13 +151,19 @@ public class RedactDevice : MonoBehaviour
|
|||
yield return StartCoroutine(saveJson());
|
||||
if (URlreturn != null && URlreturn.message == "操作成功")
|
||||
{
|
||||
yield return StartCoroutine(Succeed());
|
||||
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
StartCoroutine(Succeed((x) =>
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
GameManager.Inst. objectToShow_add.gameObject.SetActive(true);
|
||||
if (x)
|
||||
{
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
GameManager.Inst.objectToShow_add.gameObject.SetActive(true);
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -119,11 +171,28 @@ public class RedactDevice : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public IEnumerator Succeed()
|
||||
public IEnumerator Succeed(Action<bool> callback)
|
||||
{
|
||||
yield return StartCoroutine(GameManager.Inst.Initialize());
|
||||
Array.ForEach(GameObject.FindObjectsOfType<UPosItem>(), (item) =>
|
||||
{
|
||||
item.isOccupied = false;
|
||||
});
|
||||
GameManager.Inst.isLoading = false;
|
||||
|
||||
TransparentGlowManage.Inst.addScript();
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Device());
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Port());
|
||||
|
||||
|
||||
yield return StartCoroutine(LineQuery.Inst.getJsonCoroutine());
|
||||
|
||||
GameManager.Inst.LoadScene();
|
||||
callback.Invoke(true);
|
||||
}
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ using static GameManager;
|
|||
/// </summary>
|
||||
public class RedactPort : MonoBehaviour
|
||||
{
|
||||
public Body mybody;
|
||||
public Body mybody = new Body();
|
||||
public Root URlreturn;
|
||||
//public PortQuery.Root root;
|
||||
public Button save_bt;
|
||||
|
|
@ -62,8 +62,8 @@ public class RedactPort : MonoBehaviour
|
|||
|
||||
public InputField cableName;
|
||||
|
||||
MapperConfiguration config;
|
||||
IMapper mapper;
|
||||
//MapperConfiguration config;
|
||||
//IMapper mapper;
|
||||
private void OnEnable()
|
||||
{
|
||||
//config = new MapperConfiguration(cfg =>
|
||||
|
|
@ -101,7 +101,6 @@ public class RedactPort : MonoBehaviour
|
|||
cableName.text = mybody.cableName;
|
||||
//deviceId.text = mybody.deviceId;
|
||||
portModel.text = mybody.portModel;
|
||||
|
||||
conDevice.captionText.text = mybody.conDevice;
|
||||
status.value = string.IsNullOrEmpty(mybody.status) ? 2 : Convert.ToInt32(mybody.status);
|
||||
if (!string.IsNullOrEmpty(mybody.conDevice))
|
||||
|
|
@ -120,7 +119,7 @@ public class RedactPort : MonoBehaviour
|
|||
}
|
||||
else
|
||||
{
|
||||
conDevice.captionText.text = "";
|
||||
conDevice.captionText.text = null;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
@ -132,12 +131,12 @@ public class RedactPort : MonoBehaviour
|
|||
{
|
||||
mybody = new Body();
|
||||
|
||||
config = new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<RedactPort.Body, PortQuery.PortList>();
|
||||
cfg.CreateMap<PortQuery.PortList, RedactPort.Body>();
|
||||
});
|
||||
mapper = config.CreateMapper();
|
||||
//config = new MapperConfiguration(cfg =>
|
||||
//{
|
||||
// cfg.CreateMap<RedactPort.Body, PortQuery.PortList>();
|
||||
// cfg.CreateMap<PortQuery.PortList, RedactPort.Body>();
|
||||
//});
|
||||
//mapper = config.CreateMapper();
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(GameManager.Inst.nowDeviceID))
|
||||
|
|
@ -150,7 +149,28 @@ public class RedactPort : MonoBehaviour
|
|||
break;
|
||||
}
|
||||
}
|
||||
mybody = mapper.Map<RedactPort.Body>(portlist);
|
||||
//mybody = mapper.Map<RedactPort.Body>(portlist);
|
||||
if (portlist != null)
|
||||
{
|
||||
mybody.id = portlist.id;
|
||||
mybody.port = portlist.port;
|
||||
mybody.portCode = portlist.portCode;
|
||||
mybody.portName = portlist.portName;
|
||||
mybody.portType = portlist.portType;
|
||||
mybody.deviceId = portlist.deviceId;
|
||||
mybody.deviceName = portlist.deviceName;
|
||||
mybody.portModel = portlist.portModel;
|
||||
mybody.status = portlist.status;
|
||||
mybody.conDevice = portlist.conDevice;
|
||||
mybody.conDevice = portlist.conDeviceName;
|
||||
mybody.conPort = portlist.conPort;
|
||||
mybody.cableName = portlist.cableName;
|
||||
mybody.cableGroupName = portlist.cableGroupName;
|
||||
mybody.remark = portlist.remark;
|
||||
mybody.createTime = portlist.createTime;
|
||||
mybody.createName = portlist.createName;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
@ -164,12 +184,12 @@ public class RedactPort : MonoBehaviour
|
|||
/// </summary>
|
||||
public void syncInfo()
|
||||
{
|
||||
config = new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<RedactPort.Body, PortQuery.PortList>();
|
||||
cfg.CreateMap<PortQuery.PortList, RedactPort.Body>();
|
||||
});
|
||||
mapper = config.CreateMapper();
|
||||
//config = new MapperConfiguration(cfg =>
|
||||
//{
|
||||
// cfg.CreateMap<RedactPort.Body, PortQuery.PortList>();
|
||||
// cfg.CreateMap<PortQuery.PortList, RedactPort.Body>();
|
||||
//});
|
||||
//mapper = config.CreateMapper();
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(GameManager.Inst.nowDeviceID))
|
||||
|
|
@ -182,7 +202,27 @@ public class RedactPort : MonoBehaviour
|
|||
break;
|
||||
}
|
||||
}
|
||||
mybody = mapper.Map<RedactPort.Body>(portlist);
|
||||
//mybody = mapper.Map<RedactPort.Body>(portlist);
|
||||
if (portlist != null)
|
||||
{
|
||||
mybody.id = portlist.id;
|
||||
mybody.port = portlist.port;
|
||||
mybody.portCode = portlist.portCode;
|
||||
mybody.portName = portlist.portName;
|
||||
mybody.portType = portlist.portType;
|
||||
mybody.deviceId = portlist.deviceId;
|
||||
mybody.deviceName = portlist.deviceName;
|
||||
mybody.portModel = portlist.portModel;
|
||||
mybody.status = portlist.status;
|
||||
mybody.conDevice = portlist.conDevice;
|
||||
mybody.conDevice = portlist.conDeviceName;
|
||||
mybody.conPort = portlist.conPort;
|
||||
mybody.cableName = portlist.cableName;
|
||||
mybody.cableGroupName = portlist.cableGroupName;
|
||||
mybody.remark = portlist.remark;
|
||||
mybody.createTime = portlist.createTime;
|
||||
mybody.createName = portlist.createName;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
@ -237,6 +277,7 @@ public class RedactPort : MonoBehaviour
|
|||
Dropdown.OptionData optionData = new Dropdown.OptionData(item);
|
||||
cableGroupName.options.Add(optionData);
|
||||
}
|
||||
cableGroupName.captionText.text = null;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -244,6 +285,8 @@ public class RedactPort : MonoBehaviour
|
|||
{
|
||||
save_bt.onClick.AddListener(() =>
|
||||
{
|
||||
GameManager.Inst.editorMenu.gameObject.SetActive(false);
|
||||
|
||||
StartCoroutine(SaveJsonCoroutine());
|
||||
});
|
||||
conDevice.onValueChanged.AddListener(OnDropdownValueChanged_conDevice);
|
||||
|
|
@ -253,26 +296,45 @@ public class RedactPort : MonoBehaviour
|
|||
|
||||
private IEnumerator SaveJsonCoroutine()
|
||||
{
|
||||
yield return StartCoroutine(saveJson());
|
||||
if (URlreturn != null && URlreturn.message == "操作成功")
|
||||
Debug.Log("@@1");
|
||||
yield return StartCoroutine(saveJson((x) =>
|
||||
{
|
||||
yield return StartCoroutine(Succeed());
|
||||
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
//Debug.Log("@@8");
|
||||
if (URlreturn != null && URlreturn.message == "操作成功")
|
||||
{
|
||||
StartCoroutine(Succeed((x)=>
|
||||
{
|
||||
if (x)
|
||||
{
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
itme.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public IEnumerator Succeed(Action<string> callback = null)
|
||||
public IEnumerator Succeed(Action<bool> callback)
|
||||
{
|
||||
yield return StartCoroutine(GameManager.Inst.Initialize());
|
||||
callback?.Invoke("1");
|
||||
GameManager.Inst.isLoading = false;
|
||||
|
||||
TransparentGlowManage.Inst.addScript();
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Device());
|
||||
|
||||
yield return StartCoroutine(GameManager.Inst.init_Port());
|
||||
|
||||
|
||||
yield return StartCoroutine(LineQuery.Inst.getJsonCoroutine());
|
||||
|
||||
GameManager.Inst.LoadScene();
|
||||
callback.Invoke(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -336,11 +398,12 @@ public class RedactPort : MonoBehaviour
|
|||
/// 端口-编辑保存
|
||||
/// </summary>
|
||||
/// <param name="token"></param>
|
||||
public IEnumerator saveJson()
|
||||
public IEnumerator saveJson(Action<string> callback = null)
|
||||
{
|
||||
//Debug.Log("@@2");
|
||||
if (string.IsNullOrEmpty(mybody.id))
|
||||
yield break;
|
||||
|
||||
//Debug.Log("@@3");
|
||||
try
|
||||
{
|
||||
mybody.port = port.text;
|
||||
|
|
@ -361,7 +424,7 @@ public class RedactPort : MonoBehaviour
|
|||
//gameObject.SetActive(false);
|
||||
yield break;
|
||||
}
|
||||
|
||||
//Debug.Log("@@4");
|
||||
|
||||
string newData = JsonConvert.SerializeObject(mybody);
|
||||
//Debug.Log(json);
|
||||
|
|
@ -369,9 +432,12 @@ public class RedactPort : MonoBehaviour
|
|||
yield return StartCoroutine(
|
||||
CombineJSON.UpdateJson_POST(GameManager.Inst.Jk_URL.dk_bj, GameManager.Inst.arguments.token, newData, (jsonResult) =>
|
||||
{
|
||||
//Debug.Log("@@5");
|
||||
try
|
||||
{
|
||||
URlreturn = JsonConvert.DeserializeObject<Root>(jsonResult);
|
||||
callback?.Invoke("1");
|
||||
//Debug.Log("@@6");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -253,7 +253,10 @@ public class LineQuery : MonoBehaviour
|
|||
}
|
||||
if (redact.URlreturn != null && redact.URlreturn.message == "操作成功")
|
||||
{
|
||||
StartCoroutine(redact.Succeed());
|
||||
StartCoroutine(redact.Succeed((x)=>
|
||||
{
|
||||
|
||||
}));
|
||||
|
||||
Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using UnityEngine;
|
|||
using UnityEngine.EventSystems;
|
||||
|
||||
/// <summary>
|
||||
/// 柜子点击脚本
|
||||
/// µã»÷½Å±¾
|
||||
/// </summary>
|
||||
public class ClickEvent : MonoBehaviour
|
||||
{
|
||||
|
|
@ -583,12 +583,19 @@ public class ClickEvent : MonoBehaviour
|
|||
{
|
||||
Array.ForEach(cabine.GetComponentsInChildren<PortQuery>(), (itme) =>
|
||||
{
|
||||
itme.hight.GetComponent<Renderer>().materials[0] = Resources.Load<Material>("Materials/4Tou");
|
||||
Renderer renderer = itme.transform.GetChild(0).GetComponent<Renderer>();
|
||||
|
||||
Material[] sharedMaterials = renderer.sharedMaterials;
|
||||
|
||||
sharedMaterials[0] = Resources.Load<Material>("Materials/4Tou"); ;
|
||||
|
||||
renderer.sharedMaterials = sharedMaterials;
|
||||
itme.hight.SetActive(true);
|
||||
});
|
||||
}
|
||||
|
||||
GameManager.Inst.gameObject.GetComponent<DeviceManager>().dragController.uPosManger = cabine.transform.Find("U位").GetComponent<UPosManger>();
|
||||
if (cabine.transform.Find("Uλ"))
|
||||
GameManager.Inst.gameObject.GetComponent<DeviceManager>().dragController.uPosManger = cabine.transform.Find("Uλ").GetComponent<UPosManger>();
|
||||
|
||||
ExtendedFlycam.Inst.CameraRtDisable();
|
||||
CameraMgr.Instance.StoreTarget();
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
http://172.16.1.68:8081/
|
||||
http://127.0.0.1:8081/
|
||||
Loading…
Reference in New Issue