diff --git a/GQ_TongXin/Assets/UI/古泉切图/红外.png b/GQ_TongXin/Assets/UI/古泉切图/红外.png new file mode 100644 index 000000000..451afe467 Binary files /dev/null and b/GQ_TongXin/Assets/UI/古泉切图/红外.png differ diff --git a/GQ_TongXin/Assets/UI/古泉切图/红外.png.meta b/GQ_TongXin/Assets/UI/古泉切图/红外.png.meta new file mode 100644 index 000000000..fa6bf21a3 --- /dev/null +++ b/GQ_TongXin/Assets/UI/古泉切图/红外.png.meta @@ -0,0 +1,134 @@ +fileFormatVersion: 2 +guid: dd0c61f425d71ad4c9c9c185ca27a124 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/GQ_TongXin/Assets/script/GameManager.cs b/GQ_TongXin/Assets/script/GameManager.cs index 2fcae885c..4a4f43b17 100644 --- a/GQ_TongXin/Assets/script/GameManager.cs +++ b/GQ_TongXin/Assets/script/GameManager.cs @@ -111,6 +111,12 @@ public class GameManager : MonoBehaviour [Header("----------弹窗--------------")] public List pop_ups; + /// + /// 场景方大状态 + /// + [Header("----------场景方大状态--------------")] + public bool magnifyState=false; + private void Awake() { if (_inst != null && _inst != this) @@ -509,10 +515,12 @@ public class GameManager : MonoBehaviour var collider = item.transform.Find("U位/" + U).GetComponent(); go.transform.position = new Vector3(anchorPos.transform.position.x, anchorPos.transform.position.y + collider.bounds.size.y / 2, anchorPos.transform.position.z); //go.transform.rotation = item.transform.Find("U位/" + U).rotation; - go.name = Racks[i].deviceName; + go.name = Racks[i].id; if (!go.GetComponent()) go.AddComponent(); + go.GetComponent().isplace = true; go.transform.SetParent(item.transform.Find("U位/" + U)); + go.GetComponent().isplace = true; break; } catch (Exception e) @@ -639,7 +647,7 @@ public class GameManager : MonoBehaviour { DestroyImmediate(TmsCards_go[i]); } - + Cabinets.Clear(); Racks_go.Clear(); diff --git a/GQ_TongXin/Assets/script/接口/修改/AddDevice.cs b/GQ_TongXin/Assets/script/接口/修改/AddDevice.cs index f9e4fb6bc..3ef80c108 100644 --- a/GQ_TongXin/Assets/script/接口/修改/AddDevice.cs +++ b/GQ_TongXin/Assets/script/接口/修改/AddDevice.cs @@ -15,7 +15,7 @@ using static GameManager; public class AddDevice : MonoBehaviour { public Root URlreturn; - public Body mybody; + public Body mybody=new Body(); public Button save_bt; /// diff --git a/GQ_TongXin/Assets/script/接口/修改/AddPort.cs b/GQ_TongXin/Assets/script/接口/修改/AddPort.cs index c93e19842..5beb434a6 100644 --- a/GQ_TongXin/Assets/script/接口/修改/AddPort.cs +++ b/GQ_TongXin/Assets/script/接口/修改/AddPort.cs @@ -5,6 +5,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; using static GameManager; @@ -14,7 +15,7 @@ using static GameManager; public class AddPort : MonoBehaviour { public Root URlreturn; - public Body mybody; + public Body mybody = new Body(); public Button save_bt; @@ -62,7 +63,12 @@ public class AddPort : MonoBehaviour break; } } - mybody = mapper.Map(portlist); + if (portlist != null) + mybody = mapper.Map(portlist); + else + { + mybody = mapper.Map(GameManager.Inst.nowDevice.GetComponent()); + } } } catch (Exception e) @@ -75,6 +81,7 @@ public class AddPort : MonoBehaviour { //deviceId.options.Clear(); List deviceId_ops = new List(); + deviceId_ops.Add(""); //for (int i = 0; i < GameManager.Inst.Racks_go.Count; i++) //{ // var n = GameManager.Inst.Racks_go[i].GetComponent().deviceList.id; @@ -122,19 +129,19 @@ public class AddPort : MonoBehaviour yield return StartCoroutine(saveJson()); if (URlreturn.message == "操作成功") - { - yield return StartCoroutine(GameManager.Inst.LoadAddress((ct) => - { - if (ct != null) - { - GameManager.Inst.Jk_URL = new webURL(ct); - StartCoroutine(GameManager.Inst.Initialize()); - } - else - { - Debug.Log("获取穿透错误!"); - } - })); + { + yield return StartCoroutine(GameManager.Inst.LoadAddress((ct) => + { + if (ct != null) + { + GameManager.Inst.Jk_URL = new webURL(ct); + StartCoroutine(GameManager.Inst.Initialize()); + } + else + { + Debug.Log("获取穿透错误!"); + } + })); Array.ForEach(GameManager.Inst.pop_ups.ToArray(), (itme) => { @@ -207,7 +214,7 @@ public class AddPort : MonoBehaviour gameObject.SetActive(false); yield break; } - + var newData = JsonConvert.SerializeObject(mybody); diff --git a/GQ_TongXin/Assets/script/接口/查询/DeviceQuery.cs b/GQ_TongXin/Assets/script/接口/查询/DeviceQuery.cs index f4147aaf5..51c39e60f 100644 --- a/GQ_TongXin/Assets/script/接口/查询/DeviceQuery.cs +++ b/GQ_TongXin/Assets/script/接口/查询/DeviceQuery.cs @@ -24,6 +24,8 @@ public class DeviceQuery : MonoBehaviour if (!ParentGo) return; deviceList.rackId = ParentGo.GetComponent().deviceList.id; + if(!string.IsNullOrEmpty(deviceList.id)) + gameObject.name = deviceList.id; } else if (deviceList.type == "2" && @@ -38,6 +40,8 @@ public class DeviceQuery : MonoBehaviour deviceList.shelfId = transform.parent.GetComponent().deviceList.id; } } + if (!string.IsNullOrEmpty(deviceList.id)) + gameObject.name = deviceList.id; } } @@ -86,7 +90,23 @@ public class DeviceQuery : MonoBehaviour } } + public void setTag() + { + //Transform + //try + //{ + //} + //catch + //{ + // xuhao = transform.parent; + // U = xuhao.parent; + // cabinet = U.parent; + //} + //var xuhao = transform.parent; + //var U = xuhao.parent; + //var cabinet = U.parent; + } diff --git a/GQ_TongXin/Assets/script/接口/查询/PortQuery.cs b/GQ_TongXin/Assets/script/接口/查询/PortQuery.cs index 1a5643fab..c04e64a97 100644 --- a/GQ_TongXin/Assets/script/接口/查询/PortQuery.cs +++ b/GQ_TongXin/Assets/script/接口/查询/PortQuery.cs @@ -19,6 +19,12 @@ public class PortQuery : MonoBehaviour } + private void OnEnable() + { + if (string.IsNullOrEmpty(portList.id)) + gameObject.name = portList.id; + } + private void Start() { portList.deviceId = transform.parent.GetComponent().deviceList.id; diff --git a/GQ_TongXin/Assets/script/点击/ClickEvent.cs b/GQ_TongXin/Assets/script/点击/ClickEvent.cs index 19ba9f8fe..8c86d49bf 100644 --- a/GQ_TongXin/Assets/script/点击/ClickEvent.cs +++ b/GQ_TongXin/Assets/script/点击/ClickEvent.cs @@ -18,7 +18,7 @@ public class ClickEvent : MonoBehaviour /// /// Ŵ״̬ /// - public bool magnifyState = false; + public bool My_magnifyState = false; private List meshRenderers; /// @@ -99,19 +99,20 @@ public class ClickEvent : MonoBehaviour //{ // PatternChoose.Inst.transform.Find("˿/˿").gameObject.SetActive(false); //} + - //ģͣã - if (Physics.Raycast(ray, out hit, 100, 1 << 8)) + if (Menu.M__ == CabinetUIManager.Instance.current_menu && GameManager.Inst.magnifyState) { - if (hit.collider.gameObject == gameObject) + if (Physics.Raycast(ray, out hit, 100, 1 << 8)) { - Debug.Log("" + gameObject.name); - PatternChoose.Inst.transform.Find("豸/豸").gameObject.SetActive(false); - PatternChoose.Inst.transform.Find("豸/豸").gameObject.SetActive(false); - PatternChoose.Inst.transform.Find("˿/˿").gameObject.SetActive(false); - PatternChoose.Inst.transform.Find("˿/˿").gameObject.SetActive(false); - if (Menu.M__ == CabinetUIManager.Instance.current_menu) + if (hit.collider.gameObject == gameObject) { + Debug.Log("" + gameObject.name); + PatternChoose.Inst.transform.Find("豸/豸").gameObject.SetActive(false); + PatternChoose.Inst.transform.Find("豸/豸").gameObject.SetActive(false); + PatternChoose.Inst.transform.Find("˿/˿").gameObject.SetActive(false); + PatternChoose.Inst.transform.Find("˿/˿").gameObject.SetActive(false); + GameManager.Inst.search_box.SetActive(false); var d = gameObject.GetComponent(); if (d) @@ -132,8 +133,20 @@ public class ClickEvent : MonoBehaviour } } } - else if (Menu.M___ == CabinetUIManager.Instance.current_menu) + } + } + else if (Menu.M___ == CabinetUIManager.Instance.current_menu && GameManager.Inst.magnifyState) + { + if (Physics.Raycast(ray, out hit, 100, 1 << 8)) + { + if (hit.collider.gameObject == gameObject) { + Debug.Log("" + gameObject.name); + PatternChoose.Inst.transform.Find("豸/豸").gameObject.SetActive(false); + PatternChoose.Inst.transform.Find("豸/豸").gameObject.SetActive(false); + PatternChoose.Inst.transform.Find("˿/˿").gameObject.SetActive(false); + PatternChoose.Inst.transform.Find("˿/˿").gameObject.SetActive(false); + var p = gameObject.GetComponent(); if (p) { @@ -153,23 +166,81 @@ public class ClickEvent : MonoBehaviour } } } - else - { - PatternChoose.Inst.transform.Find("豸/豸").gameObject.SetActive(false); - PatternChoose.Inst.transform.Find("˿/˿").gameObject.SetActive(false); - } } } + + #region MyRegion + ////ģͣã + //if (Physics.Raycast(ray, out hit, 100, 1 << 8)) + //{ + // if (hit.collider.gameObject == gameObject) + // { + + // if (Menu.M__ == CabinetUIManager.Instance.current_menu) + // { + // GameManager.Inst.search_box.SetActive(false); + // var d = gameObject.GetComponent(); + // if (d) + // { + // if (string.IsNullOrEmpty(d.deviceList.id)) + // { + // GameManager.Inst.nowDevice = gameObject; + + + // PatternChoose.Inst.transform.Find("豸/豸").gameObject.SetActive(true);// + // } + // else + // { + // GameManager.Inst.nowDeviceID = d.deviceList.id; + // GameManager.Inst.nowDevice = gameObject; + + // PatternChoose.Inst.transform.Find("豸/豸").gameObject.SetActive(true);// + // } + // } + // } + // else if (Menu.M___ == CabinetUIManager.Instance.current_menu) + // { + // var p = gameObject.GetComponent(); + // if (p) + // { + // if (string.IsNullOrEmpty(p.portList.id)) + // { + // GameManager.Inst.nowDevice = gameObject; + + + // PatternChoose.Inst.transform.Find("˿/˿").gameObject.SetActive(true);// + // } + // else + // { + // GameManager.Inst.nowDeviceID = p.portList.id; + // GameManager.Inst.nowDevice = gameObject; + + // PatternChoose.Inst.transform.Find("˿/˿").gameObject.SetActive(true);// + // } + // } + // } + // else + // { + // PatternChoose.Inst.transform.Find("豸/豸").gameObject.SetActive(false); + // PatternChoose.Inst.transform.Find("˿/˿").gameObject.SetActive(false); + // } + // } + //} + #endregion + + //黯 else if (Physics.Raycast(ray, out hit, 100, 1 << 6)) { //Ŵ - if (hit.collider.gameObject == gameObject && !magnifyState) + if (hit.collider.gameObject == gameObject && !My_magnifyState) { GameManager.Inst.nowDeviceID = hit.collider.gameObject.GetComponent().deviceList.id; ExtendedFlycam.Inst.init_mainCamera_rot(); // 屻 Debug.Log("Ŵ" + gameObject.name); + GameManager.Inst.nowDevice = gameObject; + GameManager.Inst.nowDeviceID = GetComponent().deviceList.id; ; Renderer renderer = null; try { @@ -183,9 +254,10 @@ public class ClickEvent : MonoBehaviour } Array.ForEach(GameObject.FindObjectsOfType(), itme => { - itme.magnifyState = false; + itme.My_magnifyState = false; }); - magnifyState = true; + My_magnifyState = true; + GameManager.Inst.magnifyState = true; TransparentGlowManage.Inst.is_magnify = true; Vector3 center = renderer.bounds.center; Vector3 targetPosition = new Vector3(center.x + yiDong_pos.x, center.y + yiDong_pos.y, center.z + yiDong_pos.z); @@ -198,10 +270,11 @@ public class ClickEvent : MonoBehaviour }); } //С - else if (hit.collider.gameObject == gameObject && magnifyState) + else if (hit.collider.gameObject == gameObject && My_magnifyState) { GameManager.Inst.nowDeviceID = null; - magnifyState = false; + My_magnifyState = false; + GameManager.Inst.magnifyState = false; TransparentGlowManage.Inst.is_magnify = false; ExtendedFlycam.Inst.init_mainCamera_rot(); // 屻 @@ -309,6 +382,7 @@ public class ClickEvent : MonoBehaviour } } } + } private void OnMouseEnter() diff --git a/GQ_TongXin/Assets/script/相机/ExtendedFlycam.cs b/GQ_TongXin/Assets/script/相机/ExtendedFlycam.cs index 0e21e7dac..bb8c29dec 100644 --- a/GQ_TongXin/Assets/script/相机/ExtendedFlycam.cs +++ b/GQ_TongXin/Assets/script/相机/ExtendedFlycam.cs @@ -152,7 +152,8 @@ public class ExtendedFlycam : MonoBehaviour BoolMonitor.Value = ismove(); if (!isvalid) - { + { + init_mainCamera_rot(); return; } //initialRotationEulerAngles = transform.localEulerAngles; @@ -231,6 +232,16 @@ public class ExtendedFlycam : MonoBehaviour public void vvvv() { { + Array.ForEach(GameObject.FindObjectsOfType(), itme => + { + itme.My_magnifyState = false; + }); + PatternChoose.Inst.transform.Find("设备类/设备配置").gameObject.SetActive(false); + PatternChoose.Inst.transform.Find("设备类/设备新增").gameObject.SetActive(false); + PatternChoose.Inst.transform.Find("端口类/端口配置").gameObject.SetActive(false); + PatternChoose.Inst.transform.Find("端口类/端口新增").gameObject.SetActive(false); + GameManager.Inst.magnifyState = false; + Inst.init_mainCamera_rot(); Inst.transform.DOLocalMove(new Vector3(4.73694f, 20.1847f, -4.738012f), 1); Inst.transform.DORotateQuaternion(Quaternion.Euler(Inst.ClampAngle(67.072f, -179.714f, -0.025f, Vector3.zero)), 1f).OnComplete(() =>