From 3d80ed9e62ca3b203ed7433d613dc9c8dadadcce Mon Sep 17 00:00:00 2001 From: huqibin <762612145@qq.com> Date: Thu, 22 May 2025 12:46:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=92=E7=BA=BF=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E4=BD=9C=E7=89=A9=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/ArtRes/Models/Materials/fa 5.mat | 129 +++++++++ Assets/ArtRes/Models/Materials/fa 5.mat.meta | 8 + .../HQB/Scene/10002_2002_03_OfficeScene.unity | 48 ++++ .../FirstPersonController.cs | 2 +- .../UI/UI_Panel/UI_GrowthPeriodPanel.prefab | 2 +- Assets/Scripts/HQB/RangeFinding.meta | 8 + Assets/Scripts/HQB/RangeFinding/Line.cs | 79 ++++++ Assets/Scripts/HQB/RangeFinding/Line.cs.meta | 11 + .../HQB/RangeFinding/LineMaterials.meta | 8 + .../RangeFinding/LineMaterials/Linecolor.mat | 126 +++++++++ .../LineMaterials/Linecolor.mat.meta | 8 + .../Scripts/HQB/RangeFinding/LookAtCamera.cs | 18 ++ .../HQB/RangeFinding/LookAtCamera.cs.meta | 11 + .../HQB/RangeFinding/MeasureDistance.prefab | 266 ++++++++++++++++++ .../RangeFinding/MeasureDistance.prefab.meta | 7 + .../Scripts/HQB/RangeFinding/RangeFinding.cs | 75 +++++ .../HQB/RangeFinding/RangeFinding.cs.meta | 11 + .../Scripts/Project/UI/UI_Panel/UI_MenuBar.cs | 4 +- Assets/StreamingAssets/plantsInfo.json | 67 +++++ Assets/StreamingAssets/plantsInfo.json.meta | 7 + 20 files changed, 891 insertions(+), 4 deletions(-) create mode 100644 Assets/ArtRes/Models/Materials/fa 5.mat create mode 100644 Assets/ArtRes/Models/Materials/fa 5.mat.meta create mode 100644 Assets/Scripts/HQB/RangeFinding.meta create mode 100644 Assets/Scripts/HQB/RangeFinding/Line.cs create mode 100644 Assets/Scripts/HQB/RangeFinding/Line.cs.meta create mode 100644 Assets/Scripts/HQB/RangeFinding/LineMaterials.meta create mode 100644 Assets/Scripts/HQB/RangeFinding/LineMaterials/Linecolor.mat create mode 100644 Assets/Scripts/HQB/RangeFinding/LineMaterials/Linecolor.mat.meta create mode 100644 Assets/Scripts/HQB/RangeFinding/LookAtCamera.cs create mode 100644 Assets/Scripts/HQB/RangeFinding/LookAtCamera.cs.meta create mode 100644 Assets/Scripts/HQB/RangeFinding/MeasureDistance.prefab create mode 100644 Assets/Scripts/HQB/RangeFinding/MeasureDistance.prefab.meta create mode 100644 Assets/Scripts/HQB/RangeFinding/RangeFinding.cs create mode 100644 Assets/Scripts/HQB/RangeFinding/RangeFinding.cs.meta create mode 100644 Assets/StreamingAssets/plantsInfo.json create mode 100644 Assets/StreamingAssets/plantsInfo.json.meta diff --git a/Assets/ArtRes/Models/Materials/fa 5.mat b/Assets/ArtRes/Models/Materials/fa 5.mat new file mode 100644 index 0000000..9726e0b --- /dev/null +++ b/Assets/ArtRes/Models/Materials/fa 5.mat @@ -0,0 +1,129 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: fa 5 + m_Shader: {fileID: -6465566751694194690, guid: 1a207e3bee00db44b940e6f362a8e148, type: 3} + m_ValidKeywords: [] + m_InvalidKeywords: + - _EMISSION + - _NORMALMAP + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BASE_COLOR_MAP: + m_Texture: {fileID: 2800000, guid: ac0fa7a6c8e3e9748ab5ea12b509a74a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BUMP_MAP: + m_Texture: {fileID: 2800000, guid: 7ac4f17a81480f9488d8ddc90d0d7b47, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EMISSION_COLOR_MAP: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _METALNESS_MAP: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _REFLECTIONS_COLOR_MAP: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _REFLECTIONS_IOR_MAP: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _REFLECTIONS_ROUGHNESS_MAP: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TRANSPARENCY_MAP: + m_Texture: {fileID: 2800000, guid: ac0fa7a6c8e3e9748ab5ea12b509a74a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _BASE_COLOR_WEIGHT: 1 + - _BUMP_MAP_STRENGTH: 0.3 + - _Blend: 0 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EMISSION_WEIGHT: 1 + - _EnvironmentReflections: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _METALNESS: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _REFLECTIONS_IOR: 1.52 + - _REFLECTIONS_ROUGHNESS: 0.45 + - _REFLECTIONS_WEIGHT: 0.089999996 + - _ReceiveShadows: 1 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _Surface: 0 + - _TRANSPARENCY: 1 + - _UVSec: 0 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BASE_COLOR: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EMISSION_COLOR: {r: 0, g: 0, b: 0, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _REFLECTIONS_COLOR: {r: 0.058823533, g: 0.058823533, b: 0.058823533, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] +--- !u!114 &5007009019920731954 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 5 diff --git a/Assets/ArtRes/Models/Materials/fa 5.mat.meta b/Assets/ArtRes/Models/Materials/fa 5.mat.meta new file mode 100644 index 0000000..0992b18 --- /dev/null +++ b/Assets/ArtRes/Models/Materials/fa 5.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 34dc4b8cbed045e4a85ff0c0130689ea +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HQB/Scene/10002_2002_03_OfficeScene.unity b/Assets/HQB/Scene/10002_2002_03_OfficeScene.unity index 2b20f48..fe34d84 100644 --- a/Assets/HQB/Scene/10002_2002_03_OfficeScene.unity +++ b/Assets/HQB/Scene/10002_2002_03_OfficeScene.unity @@ -852,6 +852,37 @@ MonoBehaviour: hitFxFadeOutDuration: 0.25 hitFxColor: {r: 1, g: 1, b: 1, a: 1} hitFxRadius: 0.5 +--- !u!1 &296597870 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 296597871} + m_Layer: 0 + m_Name: "\u6D4B\u91CF\u8FDE\u7EBF" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &296597871 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 296597870} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1787.1829, y: 599.7287, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &511699527 stripped GameObject: m_CorrespondingSourceObject: {fileID: 3057514198336764871, guid: 51c3521496de1854697d5682cc43afe5, type: 3} @@ -3976,6 +4007,7 @@ GameObject: - component: {fileID: 1986188606} - component: {fileID: 1986188607} - component: {fileID: 1986188608} + - component: {fileID: 1986188609} m_Layer: 0 m_Name: OfficeManager m_TagString: Untagged @@ -4043,6 +4075,22 @@ MonoBehaviour: rowDistance: 3 strainDistance: 3 diseasedRate: 0.5 +--- !u!114 &1986188609 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1986188604} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d112aece3ea2a5041b72e6335a308e5d, type: 3} + m_Name: + m_EditorClassIdentifier: + isClbool: 1 + isOpenDistance: 1 + prefabTransform: {fileID: 1414645914782855952, guid: ca37c5353ae04ea4ba2b300763c89ea8, type: 3} + allCLParentTransform: {fileID: 296597871} --- !u!1001 &1994208226 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Plugins/ModularFirstPersonController/FirstPersonController/FirstPersonController.cs b/Assets/Plugins/ModularFirstPersonController/FirstPersonController/FirstPersonController.cs index 9fff43f..e998af0 100644 --- a/Assets/Plugins/ModularFirstPersonController/FirstPersonController/FirstPersonController.cs +++ b/Assets/Plugins/ModularFirstPersonController/FirstPersonController/FirstPersonController.cs @@ -214,7 +214,7 @@ public class FirstPersonController : MonoBehaviour private void Update() { - //if (!EventSystem.current.IsPointerOverGameObject()) return; + if (EventSystem.current.IsPointerOverGameObject()) return; float scrollValue = Input.GetAxis("Mouse ScrollWheel"); if (scrollValue != 0) { diff --git a/Assets/Resources/UI/UI_Panel/UI_GrowthPeriodPanel.prefab b/Assets/Resources/UI/UI_Panel/UI_GrowthPeriodPanel.prefab index 74c68f2..d89d60e 100644 --- a/Assets/Resources/UI/UI_Panel/UI_GrowthPeriodPanel.prefab +++ b/Assets/Resources/UI/UI_Panel/UI_GrowthPeriodPanel.prefab @@ -378,7 +378,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 0} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: diff --git a/Assets/Scripts/HQB/RangeFinding.meta b/Assets/Scripts/HQB/RangeFinding.meta new file mode 100644 index 0000000..07a9afe --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3169fbf31b589614f8291b31d5e16ae5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/HQB/RangeFinding/Line.cs b/Assets/Scripts/HQB/RangeFinding/Line.cs new file mode 100644 index 0000000..fe1b23d --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding/Line.cs @@ -0,0 +1,79 @@ +using UnityEngine; +using TMPro; + +//距离单位 +public enum UnitType +{ + mm = 1000, //毫米 + cm = 100, //厘米 + dm = 10, //分米 + m = 1, //米 +} + +//[ExecuteInEditMode] +public class Line : MonoBehaviour +{ + public GameObject StObj, EdObj; + TextMesh tm; + LineRenderer line; + + [Header("实时绘制(较多会卡顿)")] + public bool IsRt = false; + [Header("线的粗细")] + public float LineWidth = 0.05f; + [Header("划线材质球")] + public Material LineMat; + [Header("线的颜色")] + public Color LineColor; + [Header("长度单位")] + public UnitType unittype; + + + Transform tram; + + private void Start() + { + //LineMat = new Material(Shader.Find("Standard")); + CreateTm(); + CreateLine(); + } + + void CreateTm() + { + tram = transform.Find("tm"); + if (tram != null) + tm = tram.GetComponent(); + if (tm == null) + { + tm = new GameObject("tm").AddComponent(); + tm.color = Color.white; + tm.fontSize = 2; + tm.transform.SetParent(this.transform); + //tm.GetComponent().sizeDelta = new Vector2(2, 1); + //tm.alignment = TextAlignmentOptions.Center; + } + } + void CreateLine() + { + line = gameObject.GetComponent(); + if (line == null) + line = gameObject.AddComponent(); + line.material = LineMat; + } + public void DrawLineInfo() + { + tm.text = (Vector3.Distance(StObj.transform.position, EdObj.transform.position) * (int)unittype).ToString("F1") + unittype; + tm.transform.position = (StObj.transform.position + EdObj.transform.position) / 2 + new Vector3(0, 0.1f, 0); + line.SetPositions(new Vector3[] { StObj.transform.position, EdObj.transform.position }); + line.startWidth = LineWidth; + line.endWidth = LineWidth; + LineMat.color = LineColor; + } + + void Update() + { + if (IsRt) + DrawLineInfo(); + } +} + diff --git a/Assets/Scripts/HQB/RangeFinding/Line.cs.meta b/Assets/Scripts/HQB/RangeFinding/Line.cs.meta new file mode 100644 index 0000000..d31d8a4 --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding/Line.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4972c973c90cfb94db0b9f3a72953728 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/HQB/RangeFinding/LineMaterials.meta b/Assets/Scripts/HQB/RangeFinding/LineMaterials.meta new file mode 100644 index 0000000..99b98e2 --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding/LineMaterials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a7f88205982781c43aa0addbac6f07a3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/HQB/RangeFinding/LineMaterials/Linecolor.mat b/Assets/Scripts/HQB/RangeFinding/LineMaterials/Linecolor.mat new file mode 100644 index 0000000..0609a0a --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding/LineMaterials/Linecolor.mat @@ -0,0 +1,126 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Linecolor + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _Blend: 0 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _Surface: 0 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] +--- !u!114 &7481883435380950292 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 5 diff --git a/Assets/Scripts/HQB/RangeFinding/LineMaterials/Linecolor.mat.meta b/Assets/Scripts/HQB/RangeFinding/LineMaterials/Linecolor.mat.meta new file mode 100644 index 0000000..6f124c0 --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding/LineMaterials/Linecolor.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d704fb960bf87f043b794a93136b57e2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/HQB/RangeFinding/LookAtCamera.cs b/Assets/Scripts/HQB/RangeFinding/LookAtCamera.cs new file mode 100644 index 0000000..4929b34 --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding/LookAtCamera.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LookAtCamera : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + transform.LookAt(Camera.main.transform); + } +} \ No newline at end of file diff --git a/Assets/Scripts/HQB/RangeFinding/LookAtCamera.cs.meta b/Assets/Scripts/HQB/RangeFinding/LookAtCamera.cs.meta new file mode 100644 index 0000000..9322e0f --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding/LookAtCamera.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f98e7b58b8dab145a64365c58a1a83a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/HQB/RangeFinding/MeasureDistance.prefab b/Assets/Scripts/HQB/RangeFinding/MeasureDistance.prefab new file mode 100644 index 0000000..15ea2b7 --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding/MeasureDistance.prefab @@ -0,0 +1,266 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1414645913928041328 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1414645913928041343} + - component: {fileID: 1414645913928041341} + - component: {fileID: 1414645913928041342} + m_Layer: 0 + m_Name: Ed + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1414645913928041343 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414645913928041328} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1414645914782855952} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1414645913928041341 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414645913928041328} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1414645913928041342 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414645913928041328} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1414645914252311570 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1414645914252311569} + - component: {fileID: 1414645914252311568} + m_Layer: 0 + m_Name: tm + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1414645914252311569 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414645914252311570} + 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: 1414645914782855952} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1414645914252311568 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414645914252311570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0f98e7b58b8dab145a64365c58a1a83a, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1414645914767451568 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1414645914767451583} + - component: {fileID: 1414645914767451581} + - component: {fileID: 1414645914767451582} + m_Layer: 0 + m_Name: St + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1414645914767451583 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414645914767451568} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1414645914782855952} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1414645914767451581 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414645914767451568} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1414645914767451582 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414645914767451568} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1414645914782855953 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1414645914782855952} + - component: {fileID: 1414645914782855967} + m_Layer: 0 + m_Name: MeasureDistance + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1414645914782855952 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414645914782855953} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1787.1829, y: 599.7287, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1414645914767451583} + - {fileID: 1414645913928041343} + - {fileID: 1414645914252311569} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1414645914782855967 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414645914782855953} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4972c973c90cfb94db0b9f3a72953728, type: 3} + m_Name: + m_EditorClassIdentifier: + StObj: {fileID: 1414645914767451568} + EdObj: {fileID: 1414645913928041328} + IsRt: 1 + LineWidth: 0.05 + LineMat: {fileID: 2100000, guid: d704fb960bf87f043b794a93136b57e2, type: 2} + LineColor: {r: 1, g: 1, b: 1, a: 1} + unittype: 0 diff --git a/Assets/Scripts/HQB/RangeFinding/MeasureDistance.prefab.meta b/Assets/Scripts/HQB/RangeFinding/MeasureDistance.prefab.meta new file mode 100644 index 0000000..0ab41a2 --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding/MeasureDistance.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ca37c5353ae04ea4ba2b300763c89ea8 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/HQB/RangeFinding/RangeFinding.cs b/Assets/Scripts/HQB/RangeFinding/RangeFinding.cs new file mode 100644 index 0000000..78654b1 --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding/RangeFinding.cs @@ -0,0 +1,75 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +//测量距离 +public class RangeFinding : MonoBehaviour +{ + //总控制 + public bool isClbool; + private Vector3 posOne, posTwo; + //测量控制 + public bool isOpenDistance; + private int distanceInt; //计数控制 + public Transform prefabTransform; //测量的预制体 + private Transform myDistanceObj; + public Transform allCLParentTransform; //所有预制体生成的父节点 + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + if (isClbool) + { + if (Input.GetMouseButtonDown(0)) + { + posOne = Input.mousePosition; + } + Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); + RaycastHit hit; + + //距离 + if (isOpenDistance) + { + if (Input.GetMouseButtonUp(0)) + { + posTwo = Input.mousePosition; + if (Physics.Raycast(ray, out hit, 1000) && posOne == posTwo) + { + if (distanceInt == 0) + { + distanceInt++; + //鼠标点击克隆物体 + myDistanceObj = Instantiate(prefabTransform, allCLParentTransform); + // transform.TransformPoint(Prefab,hit.poit, Quaternion.identity); + myDistanceObj.transform.GetChild(0).position = hit.point; + + } + else + { + + myDistanceObj.transform.GetChild(1).position = hit.point; + //isOpenJL = false; + distanceInt = 0; + } + + } + } + if (distanceInt > 0) + { + if (Physics.Raycast(ray, out hit, 1000)) + { + + myDistanceObj.transform.GetChild(1).position = hit.point; + } + } + } + } + } +} + + diff --git a/Assets/Scripts/HQB/RangeFinding/RangeFinding.cs.meta b/Assets/Scripts/HQB/RangeFinding/RangeFinding.cs.meta new file mode 100644 index 0000000..b154229 --- /dev/null +++ b/Assets/Scripts/HQB/RangeFinding/RangeFinding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d112aece3ea2a5041b72e6335a308e5d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Project/UI/UI_Panel/UI_MenuBar.cs b/Assets/Scripts/Project/UI/UI_Panel/UI_MenuBar.cs index 8b1fad0..d865b61 100644 --- a/Assets/Scripts/Project/UI/UI_Panel/UI_MenuBar.cs +++ b/Assets/Scripts/Project/UI/UI_Panel/UI_MenuBar.cs @@ -159,11 +159,11 @@ public class UI_MenuBar : BasePanel //CloseMenu(); toolRoomBtn.gameObject.SetActive(false);//.SetActive(type != E_SceneType.ToolRoom); siteBtn.gameObject.SetActive(false);//.SetActive(type == E_SceneType.ToolRoom); - workOrderBtn.gameObject.SetActive(false);//.SetActive(type == E_SceneType.Office); + workOrderBtn.gameObject.SetActive(true);//.SetActive(type == E_SceneType.Office);使用工作票按钮代替测量效果 missionBtn.gameObject.SetActive(true);//.SetActive(type == E_SceneType.Office || type == E_SceneType.ToolRoom || type == E_SceneType.Site); officeBtn.gameObject.SetActive(false);//.SetActive(type == E_SceneType.ToolRoom); disassemblyAssemblyWorkOrderBtn.gameObject.SetActive(false);//.SetActive(type == E_SceneType.Office); - toolKitBtn.gameObject.SetActive(false);//.SetActive(type != E_SceneType.Office); + toolKitBtn.gameObject.SetActive(true);//.SetActive(type != E_SceneType.Office); //关闭告知单按钮 notifyBtn.gameObject.SetActive(false);//notifyBtn.gameObject.SetActive(type == E_SceneType.Site); int t = GameManager.DataMgr.d_System.subjects.Find(subject => subject.id == GameManager.RunModelMgr.schemeID).isFault; diff --git a/Assets/StreamingAssets/plantsInfo.json b/Assets/StreamingAssets/plantsInfo.json new file mode 100644 index 0000000..830bf51 --- /dev/null +++ b/Assets/StreamingAssets/plantsInfo.json @@ -0,0 +1,67 @@ +{ + "allPlants": [ + { + "plantName": "姝e父楂樼脖", + "plantParts": [ + { + "partName": "鏍", + "partIntro": "楂樼脖鏍圭郴鐢卞垵鐢熸牴鍜屾案涔呮牴缁勬垚锛屾案涔呮牴鍙堝垎涓烘鐢熸牴鍜屾敮鎸佹牴锛堜篃绉版皵鐢熸牴锛変袱绉嶃" + }, + { + "partName": "鑼", + "partIntro": "楂樼脖鑼庡張绉拌寧绉嗭紝鐢辫妭鍜岃妭闂寸粍鎴愩傚憟鍦嗙瓛褰紝琛ㄩ潰鍏夋粦銆傝妭闂寸殑澶氬皯鍜岄暱鐭洜鍝佺鍜屾牻鍩规潯浠惰屽紓銆" + }, + { + "partName": "鍙", + "partIntro": "楂樼脖鍙剁敱鍙剁墖銆佸彾闉樺拰鍙惰垖缁勬垚銆傚彾鐗囪鏈夎湣璐紝鍙剁墖澶氬憟鎶拡褰紝涓ぎ鏈変竴涓ぇ鐨勪富鑴夛紙涓剦锛夛紝棰滆壊鍥犲搧绉嶈屽紓锛屽鍛堢櫧銆侀粍銆佹殫缁夸笁绉嶃" + }, + { + "partName": "鏋", + "partIntro": "楂樻煋绫界矑锛屼範鎯笂绉颁负绉嶅瓙锛屽睘棰栨灉銆傜瀛愬憟鍗靛舰鎴栨き鍦嗗舰锛屽憟瑜愯壊銆佹鑹层佺櫧鑹叉垨娣¢粍鑹层" + } + ] + }, + { + "plantName": "鐥呮牚楂樼脖", + "plantParts": [ + { + "partName": "鏍", + "partIntro": "鐥呮牚楂樼脖鏍" + }, + { + "partName": "鑼", + "partIntro": "鐥呮牚楂樼脖鑼" + }, + { + "partName": "鍙", + "partIntro": "鐥呮牚楂樼脖鍙" + }, + { + "partName": "鏋", + "partIntro": "鐥呮牚楂樼脖鏋" + } + ] + }, + { + "plantName": "鐜夌背", + "plantParts": [ + { + "partName": "鏍", + "partIntro": "鐜夌背鏍" + }, + { + "partName": "鑼", + "partIntro": "鐜夌背鑼" + }, + { + "partName": "鍙", + "partIntro": "鐜夌背鍙" + }, + { + "partName": "鏋", + "partIntro": "鐜夌背鏋" + } + ] + } + ] +} \ No newline at end of file diff --git a/Assets/StreamingAssets/plantsInfo.json.meta b/Assets/StreamingAssets/plantsInfo.json.meta new file mode 100644 index 0000000..aae04ec --- /dev/null +++ b/Assets/StreamingAssets/plantsInfo.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1a9ca9b99e6a95a4d9fa27141e63579d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: