From aa9482875c4acddc4bee39638278d913da4f45d3 Mon Sep 17 00:00:00 2001 From: keshaohong <740612340@qq.com> Date: Sun, 5 Jul 2026 03:24:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=93=E7=AE=97=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E8=BF=94=E5=9B=9E=E4=B8=BB=E7=95=8C=E9=9D=A2=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unity/Assets/Scenes/Gameplay.unity | 216 ++++++------------ unity/Assets/UI/GameLostOverlay.cs | 17 ++ unity/Assets/UI/Materials/WaterRippleFade.mat | 41 +++- 3 files changed, 118 insertions(+), 156 deletions(-) diff --git a/unity/Assets/Scenes/Gameplay.unity b/unity/Assets/Scenes/Gameplay.unity index 8d5d5c5..c73fdb1 100644 --- a/unity/Assets/Scenes/Gameplay.unity +++ b/unity/Assets/Scenes/Gameplay.unity @@ -694,84 +694,72 @@ GameObject: m_Component: - component: {fileID: 68438038} - component: {fileID: 68438039} + - component: {fileID: 68438040} m_Layer: 0 m_HasEditorInfo: 1 - m_Name: lost + m_Name: lostTitleImage m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &68438038 -Transform: +--- !u!224 &68438038 +RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 68438037} - serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -14, y: 61, z: 0} - m_LocalScale: {x: 1.706414, y: 1.706414, z: 1.706414} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.9, y: 0.9, z: 0.9} m_ConstrainProportionsScale: 1 m_Children: [] - m_Father: {fileID: 922024178} + m_Father: {fileID: 1490576152} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!212 &68438039 -SpriteRenderer: + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -14.0000105, y: 212} + m_SizeDelta: {x: 1169, y: 243} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &68438039 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 68438037} + m_CullTransparentMesh: 1 +--- !u!114 &68438040 +MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 68438037} m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 0 - m_RayTraceProcedural: 0 - m_virtualGeometry: 0 - m_virtualGeometryShadow: 0 - m_ShadingRate: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - 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: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_Sprite: {fileID: 21300000, guid: 0f01c8b108b020b4ea35929b92863b2d, type: 3} + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 2d4ef2f4a2f0eb2479ece51f60be054d, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 11.69, y: 2.43} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 - m_SpriteSortPoint: 0 + 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: 21300000, guid: 0f01c8b108b020b4ea35929b92863b2d, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &68702802 GameObject: m_ObjectHideFlags: 0 @@ -1089,12 +1077,19 @@ MonoBehaviour: lostCanvas: {fileID: 1430258823} dimBackground: {fileID: 637101930} lostTitleText: {fileID: 0} - lostTitleImage: {fileID: 0} + lostTitleImage: {fileID: 68438040} leftDecoration: {fileID: 0} rightDecoration: {fileID: 0} mainMenuButton: {fileID: 549601800} mainMenuButtonImage: {fileID: 549601797} lostSFX: {fileID: 0} + titleFadeDuration: 1.5 + ripplePositionAmplitude: 8 + rippleScaleAmplitude: 0.08 + rippleFrequency: 15 + rippleMaterial: {fileID: 2100000, guid: 2d4ef2f4a2f0eb2479ece51f60be054d, type: 2} + buttonFadeDelay: 2 + buttonFadeDuration: 0.5 --- !u!4 &73055215 Transform: m_ObjectHideFlags: 0 @@ -3178,86 +3173,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 8451410411389343811, guid: 3b47d748441aeb64da7d88325a75f1b7, type: 3} m_PrefabInstance: {fileID: 221625452} m_PrefabAsset: {fileID: 0} ---- !u!1 &224985235 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 7 - m_Component: - - component: {fileID: 224985236} - - component: {fileID: 224985238} - - component: {fileID: 224985237} - m_Layer: 0 - m_HasEditorInfo: 1 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &224985236 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 224985235} - 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: 549601799} - 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 &224985237 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 224985235} - 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: 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_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 28 - 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: "\u4E3B\u754C\u9762" ---- !u!222 &224985238 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 224985235} - m_CullTransparentMesh: 1 --- !u!1001 &232215155 PrefabInstance: m_ObjectHideFlags: 0 @@ -7979,14 +7894,14 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.2} + 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: 0} + m_Sprite: {fileID: 21300000, guid: 8354e6cb92420e8488ea72cede0d1e2f, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -8015,14 +7930,13 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 224985236} + m_Children: [] m_Father: {fileID: 1490576152} 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: -80} - m_SizeDelta: {x: 200, y: 60} + m_AnchoredPosition: {x: 0, y: -324.07} + m_SizeDelta: {x: 320, y: 180} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &549601800 MonoBehaviour: @@ -10280,7 +10194,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &637101928 RectTransform: m_ObjectHideFlags: 0 @@ -10295,10 +10209,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1430258820} 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_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 49, y: 189} + m_SizeDelta: {x: 1169, y: 243} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &637101929 CanvasRenderer: @@ -10321,14 +10235,14 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 0.6} + 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: 0} + m_Sprite: {fileID: 21300000, guid: 0f01c8b108b020b4ea35929b92863b2d, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -15674,8 +15588,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 68438038} + m_Children: [] m_Father: {fileID: 1490576152} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -24794,6 +24707,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 68438038} - {fileID: 922024178} - {fileID: 549601799} m_Father: {fileID: 1430258820} diff --git a/unity/Assets/UI/GameLostOverlay.cs b/unity/Assets/UI/GameLostOverlay.cs index 3508e49..8c32a37 100644 --- a/unity/Assets/UI/GameLostOverlay.cs +++ b/unity/Assets/UI/GameLostOverlay.cs @@ -167,6 +167,23 @@ namespace GameFramework // 显示鼠标 Cursor.visible = true; Cursor.lockState = CursorLockMode.None; + + // 确保 EventSystem 有输入模块(UI 点击必需) + EnsureEventSystemInputModule(); + } + + /// + /// 确保 EventSystem 有 StandaloneInputModule,否则 UI 按钮无法响应点击。 + /// + private void EnsureEventSystemInputModule() + { + var es = UnityEngine.EventSystems.EventSystem.current; + if (es == null) return; + if (es.GetComponent() == null) + { + es.gameObject.AddComponent(); + Debug.Log("[GameLostOverlay] 已自动添加 StandaloneInputModule"); + } } /// diff --git a/unity/Assets/UI/Materials/WaterRippleFade.mat b/unity/Assets/UI/Materials/WaterRippleFade.mat index 8d48cfe..b0dcea3 100644 --- a/unity/Assets/UI/Materials/WaterRippleFade.mat +++ b/unity/Assets/UI/Materials/WaterRippleFade.mat @@ -1,5 +1,5 @@ %YAML 1.1 -%TAG !u! tag:unity3d.com,2011: +%TAG !u! tag:yousandi.cn,2023: --- !u!21 &2100000 Material: serializedVersion: 8 @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: WaterRippleFade - m_Shader: {fileID: 4800000, guid: CH0X5HutAHIq8wKmwmbkjKJlHGH/OREG19hBK3xdhB3plPoFMK+U1dw=, type: 3} + m_Shader: {fileID: 4800000, guid: 778aa0c9156d7a348908bdd760332458, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] @@ -23,18 +23,48 @@ Material: m_SavedProperties: serializedVersion: 3 m_TexEnvs: + - Base_Map: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - Normal_Map: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainBump: + 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} + - 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: + - Normal_Blend: 0.5 - _ColorMask: 15 + - _DecalMeshBiasType: 0 + - _DecalMeshDepthBias: 0 + - _DecalMeshViewBias: 0 + - _DrawOrder: 0 - _FadeAlpha: 1 - - _RippleAmplitude: 0.02 - - _RippleFrequency: 8 - - _RippleIntensity: 1 + - _RippleAmplitude: 0.0412 + - _RippleFrequency: 10.5 + - _RippleIntensity: -0 - _RippleSpeed: 3 + - _Shininess: 0.2 - _Stencil: 0 - _StencilComp: 8 - _StencilOp: 0 @@ -43,4 +73,5 @@ Material: - _UseUIAlphaClip: 0 m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Specular: {r: 0, g: 0, b: 0, a: 0} m_BuildTextureStacks: []