diff --git a/Assets/Prefabs/Scissor.prefab b/Assets/Prefabs/Scissor.prefab index da32246fb..2a57472a2 100644 --- a/Assets/Prefabs/Scissor.prefab +++ b/Assets/Prefabs/Scissor.prefab @@ -9,8 +9,11 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 4991240399770923164} - - component: {fileID: 4101671748916885094} - - component: {fileID: 4414950781642350908} + - component: {fileID: 3873790408042467491} + - component: {fileID: 445269215928254440} + - component: {fileID: 6674533810076062590} + - component: {fileID: 1989452908468670945} + - component: {fileID: 5255795508867702637} m_Layer: 0 m_Name: Scissor m_TagString: Untagged @@ -18,74 +21,34 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4991240399770923164 -Transform: +--- !u!224 &4991240399770923164 +RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2485500826200128654} - serializedVersion: 2 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_LocalScale: {x: -1, y: -1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!212 &4101671748916885094 -SpriteRenderer: + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 2, y: 2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3873790408042467491 +CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2485500826200128654} - 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_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, 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: 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: a381c88104077474e99fc58857a227bc, type: 3} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 25, y: 25} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 - m_SpriteSortPoint: 0 ---- !u!114 &4414950781642350908 + m_CullTransparentMesh: 1 +--- !u!114 &445269215928254440 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -94,8 +57,62 @@ MonoBehaviour: m_GameObject: {fileID: 2485500826200128654} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4fd53c3c93f6e48428e57a5b0d7c8a66, type: 3} + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: - cursorTexture: {fileID: 2800000, guid: a381c88104077474e99fc58857a227bc, type: 3} - rotationCorrection: {x: 0, y: 0, z: 0} + 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: 21300000, guid: a381c88104077474e99fc58857a227bc, type: 3} + m_Type: 0 + 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!114 &6674533810076062590 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2485500826200128654} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Delegates: [] +--- !u!225 &1989452908468670945 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2485500826200128654} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &5255795508867702637 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2485500826200128654} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 60e18d2cf7b5c594980578c47ba5c3ef, type: 3} + m_Name: + m_EditorClassIdentifier: + offset: {x: 0, y: 0, z: 0} diff --git a/Assets/Prefabs/ScrewDriver.prefab b/Assets/Prefabs/ScrewDriver.prefab index dfa23189d..7c54bb8e1 100644 --- a/Assets/Prefabs/ScrewDriver.prefab +++ b/Assets/Prefabs/ScrewDriver.prefab @@ -90,7 +90,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e072592968a98434d9dbfe8277602f9b, type: 3} m_Name: m_EditorClassIdentifier: - offset: {x: 0, y: 0, z: 0} + offset: {x: 0.74, y: 0.74, z: 0} --- !u!114 &6191094306318057957 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Prototype/佩佩/佩佩视觉模块.unity b/Assets/Prototype/佩佩/佩佩视觉模块.unity index 7b9cf1676..8bca03a50 100644 --- a/Assets/Prototype/佩佩/佩佩视觉模块.unity +++ b/Assets/Prototype/佩佩/佩佩视觉模块.unity @@ -910,14 +910,15 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d8bfaef6036f6054389a98770c3afb4d, type: 3} m_Name: m_EditorClassIdentifier: - faceCanvas: {fileID: 1108670798} + faceCanvas: {fileID: 929696549} repairCanvasPosition: {x: 12, y: -2, z: 0} originalCanvasPosition: {x: 0, y: 0, z: 0} repairCanvasScale: 3.5 animationDuration: 1 + isallowedRepair: 1 screwsContainer: {fileID: 1848343729} targetArea: {fileID: 0} - socketToEnable: {fileID: 1606783659} + socketToEnable: {fileID: 1606783662} --- !u!225 &18925493 CanvasGroup: m_ObjectHideFlags: 0 @@ -2615,7 +2616,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &143987103 RectTransform: m_ObjectHideFlags: 0 @@ -7597,7 +7598,7 @@ GameObject: m_Component: - component: {fileID: 309572328} - component: {fileID: 309572330} - - component: {fileID: 309572329} + - component: {fileID: 309572331} m_Layer: 0 m_Name: "\u4EBA" m_TagString: Untagged @@ -7605,55 +7606,21 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &309572328 -RectTransform: +--- !u!4 &309572328 +Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 309572327} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -2.3157008, y: 0.022000313, z: 0} m_LocalScale: {x: 0.92999995, y: 0.92999995, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1108670798} + m_Father: {fileID: 929696549} 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: -2.3157008, y: 0.022000313} - m_SizeDelta: {x: 10.72, y: 10.8} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &309572329 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 309572327} - 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: 5912171549122983469, guid: fd04c28739017964789d58d573f9fabb, type: 3} - m_Type: 0 - 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 &309572330 CanvasRenderer: m_ObjectHideFlags: 0 @@ -7662,6 +7629,58 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 309572327} m_CullTransparentMesh: 1 +--- !u!212 &309572331 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 309572327} + 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_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, 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: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 2 + m_Sprite: {fileID: 21300000, guid: 5a4229e9923d57a4dbb910be8c0693bd, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 10.72, y: 10.8} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 --- !u!1 &325563563 GameObject: m_ObjectHideFlags: 0 @@ -8672,7 +8691,8 @@ MonoBehaviour: toolBox: {fileID: 4042128} toolPrefabs: - {fileID: 5156684866132484758, guid: dac7c27f779d8db4683b60ca67946a84, type: 3} - toolCanvas: {fileID: 1141076861} + - {fileID: 2485500826200128654, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} + toolCanvas: {fileID: 1022441801} --- !u!1 &397718960 GameObject: m_ObjectHideFlags: 0 @@ -13204,6 +13224,81 @@ RectTransform: m_AnchoredPosition: {x: -4.2873006, y: 2.1517} m_SizeDelta: {x: 1.2276001, y: 1.0229999} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &647399465 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 647399466} + - component: {fileID: 647399468} + - component: {fileID: 647399467} + m_Layer: 5 + m_Name: innerbackground + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &647399466 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 647399465} + 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: 1637660640} + 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.0068, y: 0.0276} + m_SizeDelta: {x: 2.2, y: 2.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &647399467 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 647399465} + 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: 0.11320752, g: 0.022855101, b: 0.022855101, 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_Type: 0 + 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 &647399468 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 647399465} + m_CullTransparentMesh: 1 --- !u!1 &651738036 GameObject: m_ObjectHideFlags: 0 @@ -16903,6 +16998,39 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 915762552} m_CullTransparentMesh: 1 +--- !u!1 &929696548 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 929696549} + m_Layer: 0 + m_Name: Face + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &929696549 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 929696548} + serializedVersion: 2 + 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: 309572328} + - {fileID: 1108670798} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &935469695 GameObject: m_ObjectHideFlags: 0 @@ -18245,6 +18373,108 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1009443625} m_CullTransparentMesh: 1 +--- !u!1 &1022441797 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1022441798} + - component: {fileID: 1022441801} + - component: {fileID: 1022441800} + - component: {fileID: 1022441799} + m_Layer: 5 + m_Name: ToolUpperCableCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1022441798 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1022441797} + 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: 1637660640} + m_Father: {fileID: 2027266814} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: -960, y: -540} + m_SizeDelta: {x: 18, y: 10} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1022441799 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1022441797} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1022441800 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1022441797} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 1 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!223 &1022441801 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1022441797} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 959782197 + m_SortingOrder: 8 + m_TargetDisplay: 0 --- !u!1 &1028111264 GameObject: m_ObjectHideFlags: 0 @@ -19296,7 +19526,7 @@ Canvas: m_VertexColorAlwaysGammaSpace: 0 m_AdditionalShaderChannelsFlag: 0 m_UpdateRectTransformForStandalone: 0 - m_SortingLayerID: 0 + m_SortingLayerID: 1607245853 m_SortingOrder: 2 m_TargetDisplay: 0 --- !u!224 &1108670798 @@ -19311,7 +19541,6 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 309572328} - {fileID: 147027245} - {fileID: 948128554} - {fileID: 646902526} @@ -19323,7 +19552,7 @@ RectTransform: - {fileID: 294748450} - {fileID: 790598551} - {fileID: 1705798747} - m_Father: {fileID: 0} + m_Father: {fileID: 929696549} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -20502,13 +20731,13 @@ MonoBehaviour: interactiveLineSegmentPrefab: {fileID: 1631752023640685220, guid: 6723369fb5eae81409a3677ffa80f504, type: 3} lineSegmentInfos: - Name: MemoryEye - StartTransform: {fileID: 0} - EndTransform: {fileID: 0} + StartTransform: {fileID: 1376336156} + EndTransform: {fileID: 1197222020} - Name: MemoryUF - StartTransform: {fileID: 0} - EndTransform: {fileID: 0} + StartTransform: {fileID: 1197222020} + EndTransform: {fileID: 1106034699} physicLineSegmentPrefab: {fileID: 3614166255594274803, guid: de9108583f2ddb646a6dc8e87e791e48, type: 3} - customCursor: {fileID: 1761949063} + customCursor: {fileID: 0} --- !u!4 &1182811777 Transform: m_ObjectHideFlags: 0 @@ -25161,14 +25390,15 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d8bfaef6036f6054389a98770c3afb4d, type: 3} m_Name: m_EditorClassIdentifier: - faceCanvas: {fileID: 1108670798} + faceCanvas: {fileID: 929696549} repairCanvasPosition: {x: 12, y: -2, z: 0} originalCanvasPosition: {x: 0, y: 0, z: 0} repairCanvasScale: 3.5 animationDuration: 1 + isallowedRepair: 0 screwsContainer: {fileID: 376361520} targetArea: {fileID: 0} - socketToEnable: {fileID: 1371483726} + socketToEnable: {fileID: 1371483729} --- !u!114 &1424895148 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 9013022138806963875, guid: 6503ec55f53f1ae47be0b15b1c325375, type: 3} @@ -27768,6 +27998,81 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1619047847} m_CullTransparentMesh: 1 +--- !u!1 &1619060005 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1619060006} + - component: {fileID: 1619060008} + - component: {fileID: 1619060007} + m_Layer: 5 + m_Name: Toolimage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1619060006 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1619060005} + 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: 1637660640} + 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.0068, y: 0.0276} + m_SizeDelta: {x: 2, y: 2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1619060007 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1619060005} + 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: 0} + m_Type: 0 + 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 &1619060008 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1619060005} + m_CullTransparentMesh: 1 --- !u!1 &1624670012 GameObject: m_ObjectHideFlags: 0 @@ -28469,6 +28774,83 @@ Transform: m_CorrespondingSourceObject: {fileID: 2774148694458147747, guid: 6503ec55f53f1ae47be0b15b1c325375, type: 3} m_PrefabInstance: {fileID: 1634739317} m_PrefabAsset: {fileID: 0} +--- !u!1 &1637660639 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1637660640} + - component: {fileID: 1637660642} + - component: {fileID: 1637660641} + m_Layer: 5 + m_Name: ToolBox + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1637660640 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1637660639} + 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: 647399466} + - {fileID: 1619060006} + m_Father: {fileID: 1022441798} + 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: 3, y: -6.35} + m_SizeDelta: {x: 2.5, y: 2.5} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1637660641 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1637660639} + 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: 0.3207547, g: 0.08291204, b: 0.08291204, 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_Type: 0 + 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 &1637660642 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1637660639} + m_CullTransparentMesh: 1 --- !u!1 &1639282100 GameObject: m_ObjectHideFlags: 0 @@ -30723,114 +31105,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1758221730} m_CullTransparentMesh: 1 ---- !u!1001 &1761949062 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 2485500826200128654, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_Name - value: Scissor - objectReference: {fileID: 0} - - target: {fileID: 2485500826200128654, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_IsActive - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4101671748916885094, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_SortingLayer - value: 7 - objectReference: {fileID: 0} - - target: {fileID: 4101671748916885094, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_SortingOrder - value: 10 - objectReference: {fileID: 0} - - target: {fileID: 4101671748916885094, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_SortingLayerID - value: 959782197 - objectReference: {fileID: 0} - - target: {fileID: 4414950781642350908, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: rotationCorrection.z - value: -180 - objectReference: {fileID: 0} - - target: {fileID: 4414950781642350908, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: transformCorrection.x - value: 0.2 - objectReference: {fileID: 0} - - target: {fileID: 4414950781642350908, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: transformCorrection.y - value: -0.15 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalScale.x - value: 0.093240894 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalScale.y - value: 0.093240894 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalScale.z - value: 0.093240894 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalPosition.x - value: -4.59 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalPosition.y - value: -2.93 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} ---- !u!114 &1761949063 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 4414950781642350908, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} - m_PrefabInstance: {fileID: 1761949062} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4fd53c3c93f6e48428e57a5b0d7c8a66, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &1769484987 GameObject: m_ObjectHideFlags: 0 @@ -35394,6 +35668,7 @@ Transform: m_Children: - {fileID: 594466392} - {fileID: 1141076862} + - {fileID: 1022441798} - {fileID: 1323307890} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -37888,8 +38163,7 @@ SceneRoots: - {fileID: 859854053} - {fileID: 1875403280} - {fileID: 77790454} - - {fileID: 1761949062} - - {fileID: 1108670798} + - {fileID: 929696549} - {fileID: 490060563} - {fileID: 1731361026} - {fileID: 1278583898} diff --git a/Assets/Resources/Art/Fix/Peipei/佩佩头部.png b/Assets/Resources/Art/Fix/Peipei/佩佩头部.png new file mode 100644 index 000000000..b6f7bd058 --- /dev/null +++ b/Assets/Resources/Art/Fix/Peipei/佩佩头部.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80f607f31cca31f292301adb738e40b8a2129187a86f942ab78a0e7285d9e5e8 +size 916389 diff --git a/Assets/Resources/Art/Fix/Peipei/佩佩头部.png.meta b/Assets/Resources/Art/Fix/Peipei/佩佩头部.png.meta new file mode 100644 index 000000000..91ccf7c1d --- /dev/null +++ b/Assets/Resources/Art/Fix/Peipei/佩佩头部.png.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: 5a4229e9923d57a4dbb910be8c0693bd +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 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: 1 + 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 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 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 + ignorePlatformSupport: 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 + ignorePlatformSupport: 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 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn b/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn index 13fc6135a..3a7886c70 100644 --- a/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn +++ b/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn @@ -55,6 +55,10 @@ position: 171,-1120 //上一步骤的matchCode <> +<> +<> + + <> <> <> @@ -80,7 +84,7 @@ title: 主维修界面 position: 170,-356 --- <> - +<> <> <> <> @@ -170,45 +174,39 @@ position: -902,-953 peipei:佩佩需要手术 peipei:我们去手术吧 <> -<> <> -[command name=activate_socket_choice /] -<> +<> +//<> + +// [command name=activate_socket_choice /] +//<> === -title: 手术 +title: CutLine tags: position: -903,-634 --- - -> MemoryEyeScissor - <> - // <> - ///<> - ///<> - ///<> - ///<> - ///<> - peipei: 啊…眼睛……我的…… - peipei: 好痛! - me: 怎么了?怪了,这不应该引起任何痛觉的… - peipei: …… - peipei: 呼…… - peipei: 好像……好多了。 - me: 还没结束…我们进视觉和UF模块复查一下吧。 - <> - <> - <> - <> - // <> - // <> - <> - -> MemoryUFScissor - me: 我们要剪的不是这个吧 - <> +<> + peipei: 啊…眼睛……我的…… + peipei: 好痛! + me: 怎么了?怪了,这不应该引起任何痛觉的… + peipei: …… + peipei: 呼…… + peipei: 好像……好多了。 + me: 还没结束…我们进视觉和UF模块复查一下吧。 + <> + <> + <> + <> +// <> +// <> + <> +<> +me: 要剪的不是这个吧 +<> === - title: 流程结束 tags: -position: 174,258 +position: 163,266 --- <> === @@ -316,7 +314,7 @@ position: 1960,-1724 === title: EyeCheckEnd -position: 1959,-1242 +position: 1959,-1240 --- <> me:这里似乎没什么新的线索了 @@ -484,7 +482,7 @@ position: -894,-1597 <> === title: OnEyeViewDeepIn -position: -569,-1821 +position: -786,-1832 --- me:啊,果然这里是有问题的 me:我们去看看 diff --git a/Assets/Scripts/FixSystem/Cable/Plug.cs b/Assets/Scripts/FixSystem/Cable/Plug.cs index 0d39e2565..eed6d312a 100644 --- a/Assets/Scripts/FixSystem/Cable/Plug.cs +++ b/Assets/Scripts/FixSystem/Cable/Plug.cs @@ -92,6 +92,10 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp public void OnPointerDown(PointerEventData eventData) { + if(ToolManager.Instance.HasTool) + { + return; + } if (!IsActive) { return; @@ -115,6 +119,10 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp public void OnDrag(PointerEventData eventData) { + if(ToolManager.Instance.HasTool) + { + return; + } if (!IsActive) { return; @@ -137,6 +145,10 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp public void OnPointerUp(PointerEventData eventData) { + if(ToolManager.Instance.HasTool) + { + return; + } if (!IsActive || IsInDialogue) { return; @@ -147,41 +159,79 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp // 通知 DialogueManager 结束拖拽 DialogueManager.Instance.SetDragging(false); + + float closestDistance = Mathf.Infinity; + Socket closestSocket = null; + Socket[] sockets = FindObjectsOfType().OfType().ToArray(); + foreach (Socket socket in sockets) + { + if(socket.IsAvailable) + { + float distance = Vector3.Distance(transform.position, socket.GetPosition()); - // 通过射线检测来检查是否有Socket - PointerEventData pointerEventData = new PointerEventData(EventSystem.current) + if (distance < closestDistance) + { + closestDistance = distance; + closestSocket = socket; + } + } + } + float snappingRange = 1f; // You might need to adjust this for WorldSpace Canvas + if (closestSocket != null && closestDistance <= snappingRange) { - position = eventData.position - }; - - List raycastResults = new List(); - GraphicRaycaster graphicRaycaster = GameObject.Find("FaceCanvas").GetComponent(); - graphicRaycaster.Raycast(pointerEventData, raycastResults); - // 查找是否有Socket被检测到 - Socket targetSocket = raycastResults - .Where(result => result.gameObject.GetComponent() != null) - .Select(result => result.gameObject.GetComponent()) - .FirstOrDefault(); - - if (targetSocket != null) - { - // 插入到找到的Socket - currentSocket = targetSocket; + currentSocket = closestSocket; currentSocket.InsertPlug(this); + initialSocket.InsertPlug(this); OnPlugInserted?.Invoke(this); // 触发插入事件 transform.position = currentSocket.GetPosition(); plugSprite.enabled = false; + //transform.rotation = startRotation; + } else - { - // 没有找到有效的Socket,将插头移动回原位置 - transform.DOMove(startPosition, 0.1f).OnComplete(() => { - initialSocket.InsertPlug(this); - OnPlugInserted?.Invoke(this); // 触发插入事件 - plugSprite.enabled = false; - }); - } + transform.DOMove(startPosition, 0.1f).OnComplete(() => + { + //transform.rotation = startRotation; + initialSocket.InsertPlug(this); + OnPlugInserted?.Invoke(this); // 触发插入事件 + plugSprite.enabled =false; // Make the plug sprite disappear when it is inserted into the initial socket. + }); + } + // 通过射线检测来检查是否有Socket + // PointerEventData pointerEventData = new PointerEventData(EventSystem.current) + // { + // position = eventData.position + // }; + + // List raycastResults = new List(); + // GraphicRaycaster graphicRaycaster = GameObject.Find("FaceCanvas").GetComponent(); + // graphicRaycaster.Raycast(pointerEventData, raycastResults); + // // 查找是否有Socket被检测到 + // Socket targetSocket = raycastResults + // .Where(result => result.gameObject.GetComponent() != null) + // .Select(result => result.gameObject.GetComponent()) + // .FirstOrDefault(); + + // if (targetSocket != null) + // { + // // 插入到找到的Socket + // currentSocket = targetSocket; + // currentSocket.InsertPlug(this); + // OnPlugInserted?.Invoke(this); // 触发插入事件 + // transform.position = currentSocket.GetPosition(); + // plugSprite.enabled = false; + // } + // else + // { + // // 没有找到有效的Socket,将插头移动回原位置 + // transform.DOMove(startPosition, 0.1f).OnComplete(() => + // { + // initialSocket.InsertPlug(this); + // OnPlugInserted?.Invoke(this); // 触发插入事件 + // plugSprite.enabled = false; + // }); + // } } @@ -191,32 +241,5 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp float snappingRange = 1.0f; // You might need to adjust this for WorldSpace Canvas Gizmos.DrawWireSphere(transform.position, snappingRange); } - private bool IsSocketBlocked(Socket socket) -{ - // 获取Socket的屏幕位置 - Vector2 socketPosition = RectTransformUtility.WorldToScreenPoint(Camera.main, socket.GetComponent().position); - - // 创建PointerEventData进行射线检测 - PointerEventData pointerEventData = new PointerEventData(EventSystem.current) - { - position = socketPosition - }; - - // 使用GraphicRaycaster检测遮挡 - GraphicRaycaster graphicRaycaster = GameObject.Find("FaceCanvas").GetComponent(); - List results = new List(); - graphicRaycaster.Raycast(pointerEventData, results); - - // 如果检测到其他UI元素遮挡,返回true - foreach (var result in results) - { - if (result.gameObject != socket.gameObject) - { - return true; // 被遮挡 - } - } - - return false; // 未被遮挡 -} } diff --git a/Assets/Scripts/FixSystem/Cable/Socket.cs b/Assets/Scripts/FixSystem/Cable/Socket.cs index 8417311f6..d4835ae8d 100644 --- a/Assets/Scripts/FixSystem/Cable/Socket.cs +++ b/Assets/Scripts/FixSystem/Cable/Socket.cs @@ -4,12 +4,19 @@ using System; public class Socket : MonoBehaviour, ISocket { - public bool IsAvailable { get; private set; } = true; + public bool IsAvailable { get; set; } = true; public Vector2 InsertionPoint => transform.position; private Plug plug=null; private YarnOption _option; private bool waitYarnCommand = false; + // private int heatNum=0; + + // public int HeatNum() + // { + // return heatNum; + // } + public bool WaitYarnCommand { get { return waitYarnCommand; } diff --git a/Assets/Scripts/FixSystem/Line/CustomCursor.cs b/Assets/Scripts/FixSystem/Line/CustomCursor.cs index 1c4467593..5698aae6b 100644 --- a/Assets/Scripts/FixSystem/Line/CustomCursor.cs +++ b/Assets/Scripts/FixSystem/Line/CustomCursor.cs @@ -33,11 +33,11 @@ public class CustomCursor : MonoBehaviour // 当禁用自定义光标时,显示默认的鼠标光标 Cursor.visible = true; } - public void Shake(float intensity, float speed) -{ - float shakeAmount = Mathf.Sin(Time.time * speed) * intensity; - transform.rotation = Quaternion.Euler(rotationCorrection + new Vector3(0, 0, shakeAmount)); -} +// public void Shake(float intensity, float speed) +// { +// float shakeAmount = Mathf.Sin(Time.time * speed) * intensity; +// transform.rotation = Quaternion.Euler(rotationCorrection + new Vector3(0, 0, shakeAmount)); +// } } diff --git a/Assets/Scripts/FixSystem/Line/InteractiveLineSegment.cs b/Assets/Scripts/FixSystem/Line/InteractiveLineSegment.cs index b5168a9f5..2cd478c46 100644 --- a/Assets/Scripts/FixSystem/Line/InteractiveLineSegment.cs +++ b/Assets/Scripts/FixSystem/Line/InteractiveLineSegment.cs @@ -143,7 +143,5 @@ private void InitializeStrokeLineRenderer() // Set the position of the BoxCollider2D to the start point boxCollider.transform.position = StartPoint; - - } } diff --git a/Assets/Scripts/FixSystem/Line/LineManager.cs b/Assets/Scripts/FixSystem/Line/LineManager.cs index 09c1f9288..6a6fa32c4 100644 --- a/Assets/Scripts/FixSystem/Line/LineManager.cs +++ b/Assets/Scripts/FixSystem/Line/LineManager.cs @@ -39,16 +39,19 @@ public class LineManager : MonoBehaviour if (isScissorsMode) { - SetScissorsCursor(); + //SetScissorsCursor(); } else { - ResetCursor(); + //ResetCursor(); } } } private Dictionary lineSegmentDictionary = new Dictionary(); + private bool isTryLineCut = false; + private bool isLineCut = false; + public IEnumerable GetLineSegmentNames() { return lineSegmentDictionary.Keys; @@ -59,6 +62,23 @@ private const float LONG_PRESS_THRESHOLD = 0.01f; // 长按阈值,可以根据 private float longPressTime = 0.0f; // 长按时间 private float detectionRadius=0.25f; +// [YarnCommand("wait_for_LineCut")] +// public IEnumerator WaitForClose() +// { +// // 这里等待关闭按钮点击事件 +// while (!isTryLineCut) +// { +// yield return null; // 每帧检查一次 +// } +// isTryLineCut=false; +// if(isLineCut) +// { +// DialogController.Instance.SetVariable("$isLineCut",true); +// DialogController.Instance.StartDialogNode("CutLine"); +// } +// //ToolManager.Instance.ShowToolBoxAfterTask(); +// } + private void SaveCutLine(string lineName) { PlayerPrefs.SetString(lineName, "cut"); @@ -75,6 +95,8 @@ public void CutLine(InteractiveLineSegment originalLineSegment, Vector3 splitPoi // 如果线段不可剪断,就直接返回,不进行剪断操作 if (!originalLineSegment.IsCuttable) { + DialogController.Instance.StartDialogNode("CutLine"); + Debug.Log("not cuttable"); return; } AudioManager.RandomPlayInteraction("wire_cut"); @@ -106,12 +128,16 @@ public void CutLine(InteractiveLineSegment originalLineSegment, Vector3 splitPoi private IEnumerator DestroyNewSegmentsAfterFade(GameObject firstLineSegmentObject, GameObject secondLineSegmentObject,InteractiveLineSegment originalLineSegment) { yield return new WaitForSeconds(1.5f); - + ToolManager.Instance.ShowToolBoxAfterTask(); yield return StartCoroutine(ScreenEffectManager.Instance.FadeIn(1)); Destroy(firstLineSegmentObject); Destroy(secondLineSegmentObject); yield return StartCoroutine(ScreenEffectManager.Instance.FadeOut(1)); - originalLineSegment.Option.SelectOption(); + isLineCut=true; + DialogController.Instance.SetVariable("$isLineCut",true); + DialogController.Instance.StartDialogNode("CutLine"); + + //originalLineSegment.Option.SelectOption(); } @@ -155,7 +181,7 @@ private void LongPressLineSegment(InteractiveLineSegment lineSegment) { if(!lineSegment.IsCuttable) { - lineSegment.Option.SelectOption(); + //lineSegment.Option.SelectOption(); return; } longPressTime += Time.deltaTime; @@ -164,20 +190,20 @@ private void LongPressLineSegment(InteractiveLineSegment lineSegment) float distance = Vector3.Distance(midpoint, lineSegment.StartPoint); // Make the scissors shake and the line segment turn red - if (longPressTime < LONG_PRESS_THRESHOLD) - { - customCursor.Shake(longPressTime * 5.0f, 10.0f); // 抖动强度随时间增加 - float progress = longPressTime / LONG_PRESS_THRESHOLD; - // Calculate the new position of the color gradient - float newPosition = progress * distance; - } - else - { + // if (longPressTime < LONG_PRESS_THRESHOLD) + // { + // customCursor.Shake(longPressTime * 5.0f, 10.0f); // 抖动强度随时间增加 + // float progress = longPressTime / LONG_PRESS_THRESHOLD; + // // Calculate the new position of the color gradient + // float newPosition = progress * distance; + // } + // else + // { // Cut the line segment CutLine(lineSegment,midpoint); IsScissorsMode=false; Debug.Log("线剪断触发了"); - } + // } } private void ExitLineSegment() { @@ -187,52 +213,52 @@ private void ExitLineSegment() } currentLineSegment = null; } -// private void Update() -// { -// if (isScissorsMode) + private void Update() +{ + if (isScissorsMode) + { + // Get the position of the mouse in world coordinates + Vector3 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition); + + // Check if there is a line segment in the scissors' detection range + Collider2D hitCollider = Physics2D.OverlapCircle(mousePosition, detectionRadius); + InteractiveLineSegment hitLineSegment = hitCollider != null ? hitCollider.GetComponent() : null; + if (hitLineSegment != null) + { + EnterLineSegment(hitLineSegment); + + if (Input.GetMouseButtonDown(0)) + { + longPressTime = 0.0f; + } + else if (Input.GetMouseButton(0)) + { + LongPressLineSegment(hitLineSegment); + } + else if (Input.GetMouseButtonUp(0)) + { + longPressTime = 0.0f; + //customCursor.ResetRotation(); // 假设你有一个方法来重置剪刀的旋转 + //currentLineSegment.ResetColor(); // 假设你有一个方法来重置线段的颜色 + } + } + else + { + ExitLineSegment(); + } + } +} +// private void SetScissorsCursor() // { -// // Get the position of the mouse in world coordinates -// Vector3 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition); - -// // Check if there is a line segment in the scissors' detection range -// Collider2D hitCollider = Physics2D.OverlapCircle(mousePosition, detectionRadius); -// InteractiveLineSegment hitLineSegment = hitCollider != null ? hitCollider.GetComponent() : null; -// if (hitLineSegment != null) -// { -// EnterLineSegment(hitLineSegment); - -// if (Input.GetMouseButtonDown(0)) -// { -// longPressTime = 0.0f; -// } -// else if (Input.GetMouseButton(0)) -// { -// LongPressLineSegment(hitLineSegment); -// } -// else if (Input.GetMouseButtonUp(0)) -// { -// longPressTime = 0.0f; -// //customCursor.ResetRotation(); // 假设你有一个方法来重置剪刀的旋转 -// //currentLineSegment.ResetColor(); // 假设你有一个方法来重置线段的颜色 -// } -// } -// else -// { -// ExitLineSegment(); -// } +// // 启用自定义光标 +// customCursor.gameObject.SetActive(true); // } -// } - private void SetScissorsCursor() - { - // 启用自定义光标 - customCursor.gameObject.SetActive(true); - } - private void ResetCursor() - { - // 禁用自定义光标 - customCursor.gameObject.SetActive(false); - } +// private void ResetCursor() +// { +// // 禁用自定义光标 +// customCursor.gameObject.SetActive(false); +// } [YarnCommand("reconnected_line")] @@ -294,22 +320,22 @@ public void DeleteLine(string input) } } -// private void Start() -// { -// foreach (LineSegmentInfo lineSegmentInfo in lineSegmentInfos) -// { -// if (IsLineCut(lineSegmentInfo.Name)) -// { -// continue; -// } -// InteractiveLineSegment newSegment = Instantiate(interactiveLineSegmentPrefab, transform); -// newSegment.StartTransform = lineSegmentInfo.StartTransform; -// newSegment.EndTransform = lineSegmentInfo.EndTransform; -// newSegment.Initialize(); -// lineSegmentDictionary.Add(lineSegmentInfo.Name, newSegment); -// } +private void Start() +{ + foreach (LineSegmentInfo lineSegmentInfo in lineSegmentInfos) + { + if (IsLineCut(lineSegmentInfo.Name)) + { + continue; + } + InteractiveLineSegment newSegment = Instantiate(interactiveLineSegmentPrefab, transform); + newSegment.StartTransform = lineSegmentInfo.StartTransform; + newSegment.EndTransform = lineSegmentInfo.EndTransform; + newSegment.Initialize(); + lineSegmentDictionary.Add(lineSegmentInfo.Name, newSegment); + } -// } +} public InteractiveLineSegment GetLineSegmentByName(string lineSegmentName) { diff --git a/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs b/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs index 7d6f7ad44..335a5abb3 100644 --- a/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs +++ b/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs @@ -35,8 +35,11 @@ public class OscilloscopeController : MonoBehaviour private Socket currentSocket; + private int heatNum=0; + void Start() { + heatNum=0; scanLine.startWidth=0.05f; scanLine.endWidth=0.05f; scanLine.gameObject.SetActive(false); @@ -52,6 +55,12 @@ public class OscilloscopeController : MonoBehaviour } + } + [YarnCommand("SetHeat")] + public void SetHeat(int heat) + { + heatNum=heat; + } private void HandlePlugInserted(Plug plug) { @@ -91,6 +100,14 @@ public class OscilloscopeController : MonoBehaviour // DialogController.Instance.SetVariable("$ViewToDeepIn",trimmedString); // DialogController.Instance.StartDialogNode("DeepInView"); } + else if(heatNum>0) + { + screenText.text="模块过热,无法深入"; + + //transitionManager.SetViewAvailability(trimmedString, true); + //DeepInButton.interactable=false; + //HandleDeepIn(); + } else if(currentSocket.targetData.HasExternalError()) { transitionManager.SetViewAvailability(trimmedString, true); @@ -241,9 +258,6 @@ private IEnumerator ScanForError(string trimmedString) //screenText.text=""; } - - - void Update() { if (plug != null) @@ -255,10 +269,18 @@ private IEnumerator ScanForError(string trimmedString) var targetData = currentSocket.targetData; if (targetData != null) { + if(heatNum>0) + { + screenText.text="模块过热,无法深入"; + waveformVisualizer.waveformType = WaveformType.Noise; + waveformVisualizer.clarity = 1; + return; + } if(targetData.HasExternalError()) { screenText.text="外部错误已关联,可以直接深入"; + //waveformVisualizer.gameObject.SetActive(false); return; } @@ -304,6 +326,7 @@ private IEnumerator ScanForError(string trimmedString) void ResetVisualizer() { + waveformVisualizer.waveformType = WaveformType.Noise; waveformVisualizer.clarity = 0; waveformVisualizer.ResetWaveform(); diff --git a/Assets/Scripts/FixSystem/Scope/TargetPointData.cs b/Assets/Scripts/FixSystem/Scope/TargetPointData.cs index ca1effa9d..b2a859c74 100644 --- a/Assets/Scripts/FixSystem/Scope/TargetPointData.cs +++ b/Assets/Scripts/FixSystem/Scope/TargetPointData.cs @@ -11,6 +11,7 @@ public class TargetPointData : MonoBehaviour return isExternalError; } + [HideInInspector] public int randomShift; [HideInInspector] diff --git a/Assets/Scripts/FixSystem/Scope/WaveformVisualizer.cs b/Assets/Scripts/FixSystem/Scope/WaveformVisualizer.cs index 26f6dbfaf..f34189e71 100644 --- a/Assets/Scripts/FixSystem/Scope/WaveformVisualizer.cs +++ b/Assets/Scripts/FixSystem/Scope/WaveformVisualizer.cs @@ -234,7 +234,8 @@ float GetWaveformValue(float t, float phaseOffset) value = Mathf.PingPong(angle / (Mathf.PI * 2f), 1f) > 0.5f ? 1f : -1f; // 统一周期为 2π break; case WaveformType.Noise: - value = Mathf.PerlinNoise(angle / (Mathf.PI * 2f), Time.time * temporalFrequency) * 2f - 1f; // 统一周期为 2π + clearColor=Color.red; + value = Mathf.PerlinNoise(angle / (Mathf.PI * 0.05f), Time.time * temporalFrequency*4) * 2f - 1f; // 统一周期为 2π break; case WaveformType.Composite: value = Mathf.Sin(angle) + Mathf.Sin(angle * 2f) * 0.5f; // 组合波形也统一周期 @@ -313,6 +314,7 @@ void DrawWaveform() // 重置波形 public void ResetWaveform() { + clearColor=Color.green; isCaptured = false; phaseShift = 0f; spikeIndex=0; diff --git a/Assets/Scripts/FixSystem/Tools/Module.cs b/Assets/Scripts/FixSystem/Tools/Module.cs index 9969394ed..7cfe9032a 100644 --- a/Assets/Scripts/FixSystem/Tools/Module.cs +++ b/Assets/Scripts/FixSystem/Tools/Module.cs @@ -6,12 +6,14 @@ using UnityEngine.UI; public class Module : MonoBehaviour, IPointerClickHandler { - public RectTransform faceCanvas; // 需要移动和缩放的面板 + public Transform faceCanvas; // 需要移动和缩放的面板 public Vector3 repairCanvasPosition; // 维修模式下的面板位置 public Vector3 originalCanvasPosition; // 原始面板位置 public float repairCanvasScale = 1.5f; // 维修模式下的面板缩放比例 public float animationDuration = 0.5f; // 动画持续时间 + public bool isallowedRepair = false; // 动画持续时间 + public GameObject screwsContainer; // 螺丝的父对象 public RectTransform targetArea; // 拖拽的目标区域,用于判定维修完成 @@ -19,13 +21,16 @@ public class Module : MonoBehaviour, IPointerClickHandler private bool canDrag = false; private Vector3 initialPosition; - public Graphic socketToEnable; + + + public Socket socketToEnable; private void Start() { initialPosition = transform.position; originalCanvasPosition = faceCanvas.position; - socketToEnable.raycastTarget=false; + //socketToEnable.raycastTarget=false; + socketToEnable.IsAvailable=false; EnableScrewsInteraction(false); } @@ -60,7 +65,8 @@ public class Module : MonoBehaviour, IPointerClickHandler .SetEase(Ease.InQuad); // 恢复面板缩放 ResetModulePosition(); ToolManager.Instance.ShowToolBoxAfterTask(); - socketToEnable.raycastTarget=true; + //socketToEnable.raycastTarget=true; + socketToEnable.IsAvailable=true; } private void EnableScrewsInteraction(bool isEnabled) diff --git a/Assets/Scripts/FixSystem/Tools/Scissor.cs b/Assets/Scripts/FixSystem/Tools/Scissor.cs new file mode 100644 index 000000000..0cd17af66 --- /dev/null +++ b/Assets/Scripts/FixSystem/Tools/Scissor.cs @@ -0,0 +1,23 @@ + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using DG.Tweening; + +public class Scissor : Tool +{ + // private int rotationCount = 0; + // private int requiredRotations = 5; + // private bool isFixing = false; // 是否在维修状态 + + public override void UseTool() + { + FindObjectOfType().SetScissorsMode(true); + } + public override void ReturnTool() + { + //FindObjectOfType().SetScissorsMode(false); + } +} + + diff --git a/Assets/Scripts/FixSystem/Tools/Scissor.cs.meta b/Assets/Scripts/FixSystem/Tools/Scissor.cs.meta new file mode 100644 index 000000000..4e1d19291 --- /dev/null +++ b/Assets/Scripts/FixSystem/Tools/Scissor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 60e18d2cf7b5c594980578c47ba5c3ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/FixSystem/Tools/Screwdriver.cs b/Assets/Scripts/FixSystem/Tools/Screwdriver.cs index ca8dba23a..bb537ebc4 100644 --- a/Assets/Scripts/FixSystem/Tools/Screwdriver.cs +++ b/Assets/Scripts/FixSystem/Tools/Screwdriver.cs @@ -9,9 +9,13 @@ public class Screwdriver : Tool // private int requiredRotations = 5; // private bool isFixing = false; // 是否在维修状态 - public override void UseTool(Vector3 targetPosition) + public override void UseTool() { + } + public override void ReturnTool() + { + } // public void StartFixMode() diff --git a/Assets/Scripts/FixSystem/Tools/Tool.cs b/Assets/Scripts/FixSystem/Tools/Tool.cs index 36e368a5c..c3b155d42 100644 --- a/Assets/Scripts/FixSystem/Tools/Tool.cs +++ b/Assets/Scripts/FixSystem/Tools/Tool.cs @@ -23,6 +23,7 @@ public abstract class Tool : MonoBehaviour } // 工具的使用行为,由子类实现 - public abstract void UseTool(Vector3 targetPosition); + public abstract void UseTool(); + public abstract void ReturnTool(); } diff --git a/Assets/Scripts/FixSystem/Tools/ToolManager.cs b/Assets/Scripts/FixSystem/Tools/ToolManager.cs index 4bbec6192..5fdafd497 100644 --- a/Assets/Scripts/FixSystem/Tools/ToolManager.cs +++ b/Assets/Scripts/FixSystem/Tools/ToolManager.cs @@ -3,6 +3,7 @@ using DG.Tweening; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; +using Yarn.Unity; public class ToolManager : MonoBehaviour { @@ -46,13 +47,19 @@ public class ToolManager : MonoBehaviour } } public void TryStartRepairMode(Module module) - { + { // 如果当前工具是螺丝刀,调用Module的EnterRepairMode方法 - if (currentTool is Screwdriver) + if (currentTool is Screwdriver&&module.isallowedRepair) { module.StartRepairIfToolIsScrewdriver(currentTool); } + else + { + Debug.Log("no tool or not allowed"); + } } + + [YarnCommand("ShowTool")] public void ShowTool(string toolName) { if (toolPrefabDictionary.TryGetValue(toolName, out GameObject toolPrefab)) @@ -99,6 +106,7 @@ public class ToolManager : MonoBehaviour currentTool.transform.SetParent(toolCanvas.transform); currentTool.StartFollowMouse(); currentTool.GetComponent().blocksRaycasts=false; + currentTool.UseTool(); //RemoveToolClickEvent(eventTrigger); // 移除点击事件,防止再触发 HideTool(); }); @@ -158,6 +166,8 @@ public class ToolManager : MonoBehaviour currentTool = null; // 清空当前工具的引用 } } + // currentTool.ReturnTool(); + // currentTool = null; }); } @@ -168,8 +178,8 @@ public class ToolManager : MonoBehaviour //Vector2 imageSize = toolImage.rect.size; //Cursor.visible = false; Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); - //Vector3 toolOffset=currentTool.offset; - currentTool.transform.position = new Vector3(mousePos.x+0.75f, mousePos.y+0.75f, 0); + mousePos+=currentTool.offset; + currentTool.transform.position = new Vector3(mousePos.x, mousePos.y, 0); } if(Input.GetKeyDown(KeyCode.O)) { @@ -194,10 +204,11 @@ public void ReturnTool() currentTool.transform.SetParent(toolBox.transform); currentTool.transform.localPosition = Vector3.zero; + currentTool.ReturnTool(); + currentTool = null; + // 重新添加点击事件,以便可以再次点击 //AddToolClickEvent(currentTool.gameObject); - - currentTool = null; HideTool(); //Cursor.visible = true; } diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index c643473a7..8cb711f5b 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -63,6 +63,9 @@ TagManager: - name: UpperModule uniqueID: 349519991 locked: 0 - - name: Tool + - name: ToolUnderCable uniqueID: 959782197 locked: 0 + - name: ToolUpperCable + uniqueID: 2587710269 + locked: 0