From 45e22987c0b219229275c75f5e5bfb198acc8858 Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Mon, 23 Dec 2024 17:28:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=8A=A8=E7=94=BB=E6=97=B6?= =?UTF-8?q?=E7=BB=86=E8=8A=82=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/Scenes/Tmap 1.unity | 93 ++++++++++--------- .../Script/hylScripts/CameraSmoothMove.cs | 7 +- 2 files changed, 53 insertions(+), 47 deletions(-) diff --git a/xiaofang/Assets/Scenes/Tmap 1.unity b/xiaofang/Assets/Scenes/Tmap 1.unity index fc2638fd..658a3d67 100644 --- a/xiaofang/Assets/Scenes/Tmap 1.unity +++ b/xiaofang/Assets/Scenes/Tmap 1.unity @@ -924,6 +924,52 @@ MeshCollider: m_Convex: 0 m_CookingOptions: 30 m_Mesh: {fileID: 7238651485883819438, guid: 0c9b084f2070bda45b87da961d2eb0f6, type: 3} +--- !u!1 &67451525 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 67451527} + - component: {fileID: 67451526} + m_Layer: 0 + m_Name: BurstCollisionWorld + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &67451526 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 67451525} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f1a161c4294214a4fbcb7e9e94800494, type: 3} + m_Name: + m_EditorClassIdentifier: + cellSpans: + m_AlignBytes: 16 +--- !u!4 &67451527 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 67451525} + 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: 0} + m_RootOrder: 37 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &84373826 PrefabInstance: m_ObjectHideFlags: 0 @@ -5664,52 +5710,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 461292, guid: 96758bdbc4a29cd40a7572aed98ada0c, type: 3} m_PrefabInstance: {fileID: 233169427} m_PrefabAsset: {fileID: 0} ---- !u!1 &233356217 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 233356219} - - component: {fileID: 233356218} - m_Layer: 0 - m_Name: BurstCollisionWorld - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &233356218 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 233356217} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f1a161c4294214a4fbcb7e9e94800494, type: 3} - m_Name: - m_EditorClassIdentifier: - cellSpans: - m_AlignBytes: 16 ---- !u!4 &233356219 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 233356217} - 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: 0} - m_RootOrder: 37 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &246032604 PrefabInstance: m_ObjectHideFlags: 0 @@ -22382,6 +22382,7 @@ MonoBehaviour: scrollSpeed: 2 overlookPosition: {x: 0, y: 50, z: 0} overlookRotation: {x: -0.45922917, y: 0.5376882, z: -0.5376882, w: -0.45922917} + Canvas: {fileID: 1039624181} --- !u!1001 &1709243970 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/xiaofang/Assets/Script/hylScripts/CameraSmoothMove.cs b/xiaofang/Assets/Script/hylScripts/CameraSmoothMove.cs index 1af00f62..45a716a6 100644 --- a/xiaofang/Assets/Script/hylScripts/CameraSmoothMove.cs +++ b/xiaofang/Assets/Script/hylScripts/CameraSmoothMove.cs @@ -24,6 +24,8 @@ public class CameraSmoothMove : MonoBehaviour public Vector3 overlookPosition = new Vector3(0f, 70f, 90f); // 俯瞰视角的初始位置 public Quaternion overlookRotation = Quaternion.Euler(90f, 0f, 0f); // 俯瞰视角的旋转 + public GameObject Canvas; + private void Start() { if (target == null) @@ -42,6 +44,8 @@ public class CameraSmoothMove : MonoBehaviour fixedPosition = mainCameraTransform.position; fixedRotation = mainCameraTransform.rotation; + Canvas.gameObject.SetActive(false); + // 开始整个流程 StartCameraSequence(); } @@ -192,9 +196,10 @@ public class CameraSmoothMove : MonoBehaviour // 隐藏相机的方法 private void HideCamera() { + // 方法 1:禁用 Camera 组件 GetComponent().enabled = false; - + Canvas.gameObject.SetActive(true); Debug.Log("相机已隐藏"); } }