From 0b104f435f9c803fed7b37528371f1bb6238b5a9 Mon Sep 17 00:00:00 2001 From: bottlefish <781230111@qq.com> Date: Wed, 6 Nov 2024 22:43:36 +0800 Subject: [PATCH] =?UTF-8?q?=20=20=E6=96=B0=E5=A2=9E=E6=8B=86=E9=99=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Prefabs/ScrewDriver.prefab | 7 +- Assets/Prototype/佩佩/佩佩视觉模块.unity | 742 +++++++++++++++++- Assets/Scenes/Persistence.unity | 2 +- Assets/Scripts/FixSystem/Cable/Plug.cs | 125 +-- Assets/Scripts/FixSystem/Tools/Module.cs | 122 +++ Assets/Scripts/FixSystem/Tools/Module.cs.meta | 11 + Assets/Scripts/FixSystem/Tools/Screw.cs | 42 + Assets/Scripts/FixSystem/Tools/Screw.cs.meta | 11 + Assets/Scripts/FixSystem/Tools/Screwdriver.cs | 68 +- .../Scripts/FixSystem/Tools/ScrewsManager.cs | 24 + .../FixSystem/Tools/ScrewsManager.cs.meta | 11 + Assets/Scripts/FixSystem/Tools/Tool.cs | 1 + Assets/Scripts/FixSystem/Tools/ToolManager.cs | 37 +- 13 files changed, 1073 insertions(+), 130 deletions(-) create mode 100644 Assets/Scripts/FixSystem/Tools/Module.cs create mode 100644 Assets/Scripts/FixSystem/Tools/Module.cs.meta create mode 100644 Assets/Scripts/FixSystem/Tools/Screw.cs create mode 100644 Assets/Scripts/FixSystem/Tools/Screw.cs.meta create mode 100644 Assets/Scripts/FixSystem/Tools/ScrewsManager.cs create mode 100644 Assets/Scripts/FixSystem/Tools/ScrewsManager.cs.meta diff --git a/Assets/Prefabs/ScrewDriver.prefab b/Assets/Prefabs/ScrewDriver.prefab index 630b87d24..dfa23189d 100644 --- a/Assets/Prefabs/ScrewDriver.prefab +++ b/Assets/Prefabs/ScrewDriver.prefab @@ -30,15 +30,15 @@ RectTransform: m_GameObject: {fileID: 5156684866132484758} 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} 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: 1.6012, y: 1.6425} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 2, y: 2} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &4716682777183481428 CanvasRenderer: @@ -90,6 +90,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e072592968a98434d9dbfe8277602f9b, type: 3} m_Name: m_EditorClassIdentifier: + offset: {x: 0, y: 0, z: 0} --- !u!114 &6191094306318057957 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Prototype/佩佩/佩佩视觉模块.unity b/Assets/Prototype/佩佩/佩佩视觉模块.unity index 2ed2fd7d8..7b9cf1676 100644 --- a/Assets/Prototype/佩佩/佩佩视觉模块.unity +++ b/Assets/Prototype/佩佩/佩佩视觉模块.unity @@ -159,8 +159,8 @@ RectTransform: 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} - m_SizeDelta: {x: 2, y: 2} + 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 &4042130 MonoBehaviour: @@ -831,6 +831,8 @@ GameObject: - component: {fileID: 18925489} - component: {fileID: 18925491} - component: {fileID: 18925490} + - component: {fileID: 18925492} + - component: {fileID: 18925493} m_Layer: 0 m_Name: "UF\u76D6\u5B50" m_TagString: Untagged @@ -846,10 +848,11 @@ RectTransform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 18925488} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: -1} m_LocalScale: {x: 0.92999995, y: 0.92999995, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 1848343730} m_Father: {fileID: 1407819326} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -895,6 +898,38 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 18925488} m_CullTransparentMesh: 1 +--- !u!114 &18925492 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 18925488} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d8bfaef6036f6054389a98770c3afb4d, type: 3} + m_Name: + m_EditorClassIdentifier: + faceCanvas: {fileID: 1108670798} + repairCanvasPosition: {x: 12, y: -2, z: 0} + originalCanvasPosition: {x: 0, y: 0, z: 0} + repairCanvasScale: 3.5 + animationDuration: 1 + screwsContainer: {fileID: 1848343729} + targetArea: {fileID: 0} + socketToEnable: {fileID: 1606783659} +--- !u!225 &18925493 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 18925488} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 --- !u!1 &21742003 GameObject: m_ObjectHideFlags: 0 @@ -930,7 +965,7 @@ RectTransform: 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: 1.6012, y: 1.6425} + m_SizeDelta: {x: 2.2, y: 2.2} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &21742005 MonoBehaviour: @@ -2598,7 +2633,7 @@ RectTransform: 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: 1.6012, y: 1.6425} + m_SizeDelta: {x: 2, y: 2} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &143987104 MonoBehaviour: @@ -7552,6 +7587,81 @@ Transform: m_Children: [] m_Father: {fileID: 1434691330} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &309572327 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 309572328} + - component: {fileID: 309572330} + - component: {fileID: 309572329} + m_Layer: 0 + m_Name: "\u4EBA" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &309572328 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 309572327} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.92999995, y: 0.92999995, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1108670798} + 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 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 309572327} + m_CullTransparentMesh: 1 --- !u!1 &325563563 GameObject: m_ObjectHideFlags: 0 @@ -7972,6 +8082,302 @@ Transform: - {fileID: 353491399} m_Father: {fileID: 972406613} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!21 &367787116 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: 1b7e03285e1d48643acc2d60343f35ca, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - BLUR_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlendOp: 0 + - _BlurHD: 0 + - _BlurHQ_Intensity_1: 5.914 + - _BlurIntensity: 13 + - _BlurSize: 0.94 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorMask: 15 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _Distortion: 0 + - _DstBlend: 0 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineGlow: 1.5 + - _OutlinePixelWidth: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _SpriteFade: 1 + - _SrcBlend: 0 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _Z: 0 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 1, b: 0, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 1, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] +--- !u!1 &376361520 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 376361521} + m_Layer: 0 + m_Name: CrewsContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &376361521 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 376361520} + 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: 1814339996} + - {fileID: 1906421256} + - {fileID: 586222317} + m_Father: {fileID: 1407819326} + 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.11624989, y: 0} + m_SizeDelta: {x: 1.8692987, y: 1.9065} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &380839942 GameObject: m_ObjectHideFlags: 0 @@ -10976,6 +11382,7 @@ GameObject: - component: {fileID: 586222317} - component: {fileID: 586222319} - component: {fileID: 586222318} + - component: {fileID: 586222320} m_Layer: 0 m_Name: "UF\u4E0B\u65B9\u94C6\u9489" m_TagString: Untagged @@ -10995,11 +11402,11 @@ RectTransform: m_LocalScale: {x: 0.92999995, y: 0.92999995, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1407819326} + m_Father: {fileID: 376361521} 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.7346995, y: -0.86955} + m_AnchoredPosition: {x: 0.8509493, y: -0.86955} m_SizeDelta: {x: 0.18, y: 0.18} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &586222318 @@ -11040,6 +11447,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 586222316} m_CullTransparentMesh: 1 +--- !u!114 &586222320 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 586222316} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5c5ca7a8248fdb243aae486136ae3bb8, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &587665586 GameObject: m_ObjectHideFlags: 0 @@ -11700,6 +12119,7 @@ GameObject: - component: {fileID: 602459841} - component: {fileID: 602459843} - component: {fileID: 602459842} + - component: {fileID: 602459844} m_Layer: 0 m_Name: "UF\u76D6\u5B50\u5DE6\u4E0A\u89D2\u87BA\u4E1D_1" m_TagString: Untagged @@ -11719,11 +12139,11 @@ RectTransform: m_LocalScale: {x: 0.92999995, y: 0.92999995, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1407819326} + m_Father: {fileID: 1848343730} 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.3255005, y: 0.49754977} + m_AnchoredPosition: {x: -0.59985113, y: 0.37199992} m_SizeDelta: {x: 0.18, y: 0.18} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &602459842 @@ -11764,6 +12184,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 602459840} m_CullTransparentMesh: 1 +--- !u!114 &602459844 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 602459840} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5c5ca7a8248fdb243aae486136ae3bb8, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &603906212 GameObject: m_ObjectHideFlags: 0 @@ -12783,6 +13215,7 @@ GameObject: - component: {fileID: 651738037} - component: {fileID: 651738039} - component: {fileID: 651738038} + - component: {fileID: 651738040} m_Layer: 0 m_Name: "UF\u76D6\u5B50\u53F3\u4E0B\u89D2\u87BA\u4E1D" m_TagString: Untagged @@ -12802,11 +13235,11 @@ RectTransform: m_LocalScale: {x: 0.92999995, y: 0.92999995, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1407819326} + m_Father: {fileID: 1848343730} 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.8742006, y: -0.24645019} + m_AnchoredPosition: {x: 0.5998508, y: -0.372} m_SizeDelta: {x: 0.18, y: 0.18} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &651738038 @@ -12847,6 +13280,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 651738036} m_CullTransparentMesh: 1 +--- !u!114 &651738040 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 651738036} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5c5ca7a8248fdb243aae486136ae3bb8, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &652152508 GameObject: m_ObjectHideFlags: 0 @@ -18804,7 +19249,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 + m_BlockingObjects: 3 m_BlockingMask: serializedVersion: 2 m_Bits: 4294967295 @@ -18866,6 +19311,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 309572328} - {fileID: 147027245} - {fileID: 948128554} - {fileID: 646902526} @@ -18876,6 +19322,7 @@ RectTransform: - {fileID: 1227012526} - {fileID: 294748450} - {fileID: 790598551} + - {fileID: 1705798747} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -24670,6 +25117,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 1407819326} + - component: {fileID: 1407819327} m_Layer: 0 m_Name: UF m_TagString: Untagged @@ -24689,17 +25137,11 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 18925489} - - {fileID: 1606783658} - {fileID: 1976127639} - - {fileID: 1814339996} - - {fileID: 1906421256} - - {fileID: 586222317} - {fileID: 972296210} - - {fileID: 651738037} - - {fileID: 1434135401} - - {fileID: 1779014496} - - {fileID: 602459841} + - {fileID: 376361521} + - {fileID: 1606783658} + - {fileID: 18925489} m_Father: {fileID: 1108670798} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -24707,6 +25149,26 @@ RectTransform: m_AnchoredPosition: {x: -4.2408004, y: 0.4637501} m_SizeDelta: {x: 2.1018002, y: 1.9064999} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1407819327 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1407819325} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d8bfaef6036f6054389a98770c3afb4d, type: 3} + m_Name: + m_EditorClassIdentifier: + faceCanvas: {fileID: 1108670798} + repairCanvasPosition: {x: 12, y: -2, z: 0} + originalCanvasPosition: {x: 0, y: 0, z: 0} + repairCanvasScale: 3.5 + animationDuration: 1 + screwsContainer: {fileID: 376361520} + targetArea: {fileID: 0} + socketToEnable: {fileID: 1371483726} --- !u!114 &1424895148 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 9013022138806963875, guid: 6503ec55f53f1ae47be0b15b1c325375, type: 3} @@ -24734,6 +25196,7 @@ GameObject: - component: {fileID: 1434135401} - component: {fileID: 1434135403} - component: {fileID: 1434135402} + - component: {fileID: 1434135404} m_Layer: 0 m_Name: "UF\u76D6\u5B50\u5DE6\u4E0A\u89D2\u87BA\u4E1D" m_TagString: Untagged @@ -24753,11 +25216,11 @@ RectTransform: m_LocalScale: {x: 0.92999995, y: 0.92999995, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1407819326} + m_Father: {fileID: 1848343730} 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.3255005, y: -0.24645019} + m_AnchoredPosition: {x: -0.59985113, y: -0.372} m_SizeDelta: {x: 0.18, y: 0.18} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1434135402 @@ -24798,6 +25261,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1434135400} m_CullTransparentMesh: 1 +--- !u!114 &1434135404 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1434135400} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5c5ca7a8248fdb243aae486136ae3bb8, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1434691329 GameObject: m_ObjectHideFlags: 0 @@ -25896,7 +26371,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &1581289988 Transform: m_ObjectHideFlags: 0 @@ -26567,6 +27042,8 @@ GameObject: - component: {fileID: 1606783658} - component: {fileID: 1606783660} - component: {fileID: 1606783659} + - component: {fileID: 1606783662} + - component: {fileID: 1606783661} m_Layer: 0 m_Name: SocketUFView m_TagString: Untagged @@ -26631,6 +27108,39 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1606783657} m_CullTransparentMesh: 1 +--- !u!114 &1606783661 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1606783657} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b7407f67123179648be95c4ebf1d6281, type: 3} + m_Name: + m_EditorClassIdentifier: + waveformType: 1 + isCorrect: 0 + isExternalError: 0 + randomShift: 0 + initialRandomPhase: 0 + spikeIndex: -1 + sliderValue: -1 +--- !u!114 &1606783662 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1606783657} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} + m_Name: + m_EditorClassIdentifier: + notAlowedDeep: 0 + targetData: {fileID: 0} --- !u!21 &1609483042 Material: serializedVersion: 8 @@ -28987,6 +29497,98 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1700390216} m_CullTransparentMesh: 1 +--- !u!1 &1705798746 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1705798747} + - component: {fileID: 1705798750} + - component: {fileID: 1705798749} + - component: {fileID: 1705798748} + m_Layer: 0 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1705798747 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1705798746} + 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: 1108670798} + 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 &1705798748 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1705798746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &1705798749 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1705798746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 367787116} + m_Color: {r: 1, g: 1, b: 1, a: 0.392} + 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: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + 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 &1705798750 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1705798746} + m_CullTransparentMesh: 1 --- !u!1 &1711345137 GameObject: m_ObjectHideFlags: 0 @@ -30696,6 +31298,7 @@ GameObject: - component: {fileID: 1779014496} - component: {fileID: 1779014498} - component: {fileID: 1779014497} + - component: {fileID: 1779014499} m_Layer: 0 m_Name: "UF\u76D6\u5B50\u53F3\u4E0A\u89D2\u87BA\u4E1D" m_TagString: Untagged @@ -30715,11 +31318,11 @@ RectTransform: m_LocalScale: {x: 0.92999995, y: 0.92999995, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1407819326} + m_Father: {fileID: 1848343730} 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.8742006, y: 0.49754977} + m_AnchoredPosition: {x: 0.5998508, y: 0.37199992} m_SizeDelta: {x: 0.18, y: 0.18} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1779014497 @@ -30760,6 +31363,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1779014495} m_CullTransparentMesh: 1 +--- !u!114 &1779014499 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1779014495} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5c5ca7a8248fdb243aae486136ae3bb8, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1795052669 GameObject: m_ObjectHideFlags: 0 @@ -31008,6 +31623,7 @@ GameObject: - component: {fileID: 1814339996} - component: {fileID: 1814339998} - component: {fileID: 1814339997} + - component: {fileID: 1814339999} m_Layer: 0 m_Name: "UF\u4E0A\u65B9\u94C6\u9489" m_TagString: Untagged @@ -31027,11 +31643,11 @@ RectTransform: m_LocalScale: {x: 0.92999995, y: 0.92999995, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1407819326} + m_Father: {fileID: 376361521} 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.1953001, y: 0.86955} + m_AnchoredPosition: {x: -0.079050064, y: 0.86955} m_SizeDelta: {x: 0.18, y: 0.18} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1814339997 @@ -31072,6 +31688,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1814339995} m_CullTransparentMesh: 1 +--- !u!114 &1814339999 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1814339995} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5c5ca7a8248fdb243aae486136ae3bb8, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1816976207 GameObject: m_ObjectHideFlags: 0 @@ -31701,6 +32329,45 @@ Transform: - {fileID: 588332638} m_Father: {fileID: 972406613} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1848343729 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1848343730} + m_Layer: 0 + m_Name: CrewsContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1848343730 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1848343729} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.0752689, y: 1.0752689, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 602459841} + - {fileID: 1779014496} + - {fileID: 1434135401} + - {fileID: 651738037} + m_Father: {fileID: 18925489} + 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.06000045, y: -0.0049998313} + m_SizeDelta: {x: 1.3671011, y: 0.91139996} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1855461592 GameObject: m_ObjectHideFlags: 0 @@ -33109,6 +33776,7 @@ GameObject: - component: {fileID: 1906421256} - component: {fileID: 1906421258} - component: {fileID: 1906421257} + - component: {fileID: 1906421259} m_Layer: 0 m_Name: "UF\u5DE6\u65B9\u94C6\u9489" m_TagString: Untagged @@ -33128,11 +33796,11 @@ RectTransform: m_LocalScale: {x: 0.92999995, y: 0.92999995, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1407819326} + m_Father: {fileID: 376361521} 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.9671993, y: 0.10694957} + m_AnchoredPosition: {x: -0.8509493, y: 0.10694957} m_SizeDelta: {x: 0.18, y: 0.18} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1906421257 @@ -33173,6 +33841,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1906421255} m_CullTransparentMesh: 1 +--- !u!114 &1906421259 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1906421255} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5c5ca7a8248fdb243aae486136ae3bb8, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!21 &1912430685 Material: serializedVersion: 8 diff --git a/Assets/Scenes/Persistence.unity b/Assets/Scenes/Persistence.unity index a6e4e154a..75bf44605 100644 --- a/Assets/Scenes/Persistence.unity +++ b/Assets/Scenes/Persistence.unity @@ -1368,7 +1368,7 @@ Camera: far clip plane: 1000 field of view: 34 orthographic: 1 - orthographic size: 5 + orthographic size: 4.88 m_Depth: -1 m_CullingMask: serializedVersion: 2 diff --git a/Assets/Scripts/FixSystem/Cable/Plug.cs b/Assets/Scripts/FixSystem/Cable/Plug.cs index 840d7fc81..0d39e2565 100644 --- a/Assets/Scripts/FixSystem/Cable/Plug.cs +++ b/Assets/Scripts/FixSystem/Cable/Plug.cs @@ -135,63 +135,88 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp } } - public void OnPointerUp(PointerEventData eventData) + public void OnPointerUp(PointerEventData eventData) +{ + if (!IsActive || IsInDialogue) { - if (!IsActive) - { - return; - } - if (IsInDialogue) - { - return; - } - isDragging = false; - image.raycastTarget = true; - // 通知 DialogueManager 结束拖拽 - DialogueManager.Instance.SetDragging(false); - - float closestDistance = Mathf.Infinity; - Socket closestSocket = null; - - Socket[] sockets = FindObjectsOfType().OfType().ToArray(); - - foreach (Socket socket in sockets) - { - float distance = Vector3.Distance(transform.position, socket.GetPosition()); - - if (distance < closestDistance) - { - closestDistance = distance; - closestSocket = socket; - } - } - - float snappingRange = 1f; // You might need to adjust this for WorldSpace Canvas - if (closestSocket != null && closestDistance <= snappingRange) - { - currentSocket = closestSocket; - currentSocket.InsertPlug(this); - OnPlugInserted?.Invoke(this); // 触发插入事件 - transform.position = currentSocket.GetPosition(); - plugSprite.enabled = false; - //transform.rotation = startRotation; - } - else - { - 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. - }); - } + return; } + isDragging = false; + image.raycastTarget = true; + + // 通知 DialogueManager 结束拖拽 + DialogueManager.Instance.SetDragging(false); + + // 通过射线检测来检查是否有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; + }); + } +} + + void OnDrawGizmosSelected() { Gizmos.color = Color.yellow; 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/Tools/Module.cs b/Assets/Scripts/FixSystem/Tools/Module.cs new file mode 100644 index 000000000..9969394ed --- /dev/null +++ b/Assets/Scripts/FixSystem/Tools/Module.cs @@ -0,0 +1,122 @@ +using UnityEngine; +using UnityEngine.EventSystems; +using DG.Tweening; +using System.Drawing; // 需要引入 DOTween 命名空间 +using UnityEngine.UI; + +public class Module : MonoBehaviour, IPointerClickHandler +{ + public RectTransform faceCanvas; // 需要移动和缩放的面板 + public Vector3 repairCanvasPosition; // 维修模式下的面板位置 + public Vector3 originalCanvasPosition; // 原始面板位置 + public float repairCanvasScale = 1.5f; // 维修模式下的面板缩放比例 + public float animationDuration = 0.5f; // 动画持续时间 + + public GameObject screwsContainer; // 螺丝的父对象 + public RectTransform targetArea; // 拖拽的目标区域,用于判定维修完成 + + private bool isRepairMode = false; + private bool canDrag = false; + private Vector3 initialPosition; + + public Graphic socketToEnable; + + private void Start() + { + initialPosition = transform.position; + originalCanvasPosition = faceCanvas.position; + socketToEnable.raycastTarget=false; + EnableScrewsInteraction(false); + } + + public void StartRepairIfToolIsScrewdriver(Tool tool) + { + EnterRepairMode(); + } + + public void EnterRepairMode() + { + isRepairMode = true; + + // 使用 DOTween 对 Canvas 的位置和缩放进行平滑过渡 + faceCanvas.DOMove(repairCanvasPosition, animationDuration) + .SetEase(Ease.OutQuad) // 移动面板 + .OnComplete(() => EnableScrewsInteraction(true)); // 动画完成后才启用交互 + + faceCanvas.DOScale(repairCanvasScale, animationDuration) + .SetEase(Ease.OutQuad); // 缩放面板 + } + + public void ExitRepairMode() + { + isRepairMode = false; + + // 使用 DOTween 对 Canvas 的位置和缩放进行平滑过渡 + faceCanvas.DOMove(originalCanvasPosition, animationDuration) + .SetEase(Ease.InQuad) + .OnComplete(() => EnableScrewsInteraction(false)); // 动画完成后禁用交互 + + faceCanvas.DOScale(1f, animationDuration) + .SetEase(Ease.InQuad); // 恢复面板缩放 + ResetModulePosition(); + ToolManager.Instance.ShowToolBoxAfterTask(); + socketToEnable.raycastTarget=true; + } + + private void EnableScrewsInteraction(bool isEnabled) + { + foreach (Transform screw in screwsContainer.transform) + { + screw.GetComponent().enabled = isEnabled; + } + } + + private void ResetModulePosition() + { + transform.position = initialPosition; + canDrag = false; // 禁用拖拽,防止未拆完螺丝时拖动 + } + + public void EnableDragging() + { + canDrag = true; + } + + public void CheckAllScrews() + { + bool allDropped = true; + foreach (Transform screw in screwsContainer.transform) + { + if (screw.gameObject.activeSelf) + { + allDropped = false; + break; + } + } + + if (allDropped) + { + Destroy(gameObject); + CompleteRepair(); + } + } + + public void OnPointerClick(PointerEventData eventData) + { + // 只有在玩家已获得工具且当前工具是螺丝刀时,才尝试进入维修模式 + if (ToolManager.Instance.HasTool) + { + ToolManager.Instance.TryStartRepairMode(this); + } + else + { + Debug.Log("No tool"); + } + } + + private void CompleteRepair() + { + Debug.Log("维修完成!"); + ExitRepairMode(); + } +} diff --git a/Assets/Scripts/FixSystem/Tools/Module.cs.meta b/Assets/Scripts/FixSystem/Tools/Module.cs.meta new file mode 100644 index 000000000..e0425300c --- /dev/null +++ b/Assets/Scripts/FixSystem/Tools/Module.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d8bfaef6036f6054389a98770c3afb4d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/FixSystem/Tools/Screw.cs b/Assets/Scripts/FixSystem/Tools/Screw.cs new file mode 100644 index 000000000..6affb3bf2 --- /dev/null +++ b/Assets/Scripts/FixSystem/Tools/Screw.cs @@ -0,0 +1,42 @@ +using UnityEngine; +using UnityEngine.EventSystems; + +public class Screw : MonoBehaviour, IPointerDownHandler, IPointerUpHandler +{ + private float requiredRotation = 360f * 2; // 需要旋转的总角度(例如3圈) + private float rotationAmount = 0f; + private bool isPressed = false; + + private void Update() + { + if (isPressed) + { + float rotationSpeed = 360f; // 每秒旋转的角度 + float deltaRotation = rotationSpeed * Time.deltaTime; + rotationAmount += deltaRotation; + transform.Rotate(Vector3.forward, deltaRotation); + + if (rotationAmount >= requiredRotation) + { + Drop(); + } + } + } + + private void Drop() + { + gameObject.SetActive(false); // 螺丝掉落,可以替换成掉落动画 + // 检查父物体的所有螺丝状态 + transform.parent.parent.GetComponent().CheckAllScrews(); + } + + public void OnPointerDown(PointerEventData eventData) + { + isPressed = true; + } + + public void OnPointerUp(PointerEventData eventData) + { + isPressed = false; + } +} diff --git a/Assets/Scripts/FixSystem/Tools/Screw.cs.meta b/Assets/Scripts/FixSystem/Tools/Screw.cs.meta new file mode 100644 index 000000000..ac1c46d61 --- /dev/null +++ b/Assets/Scripts/FixSystem/Tools/Screw.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5c5ca7a8248fdb243aae486136ae3bb8 +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 19432d6f8..ca8dba23a 100644 --- a/Assets/Scripts/FixSystem/Tools/Screwdriver.cs +++ b/Assets/Scripts/FixSystem/Tools/Screwdriver.cs @@ -5,49 +5,45 @@ using DG.Tweening; public class Screwdriver : Tool { - private int rotationCount = 0; - private int requiredRotations = 5; - private bool isFixing = false; // 是否在维修状态 + // private int rotationCount = 0; + // private int requiredRotations = 5; + // private bool isFixing = false; // 是否在维修状态 public override void UseTool(Vector3 targetPosition) { - // 检查是否在维修状态 - if (isFixing && IsOverScrewSlot(targetPosition)) - { - StartRemoveScrew(); - } + } - public void StartFixMode() - { - isFixing = true; // 设置为维修模式 - } + // public void StartFixMode() + // { + // isFixing = true; // 设置为维修模式 + // } - private bool IsOverScrewSlot(Vector3 position) - { - // 假设使用碰撞检测或其他方法确认是否靠近螺丝槽位 - // 可以在此实现实际的检测逻辑 - return true; // 简单返回true用于测试 - } + // private bool IsOverScrewSlot(Vector3 position) + // { + // // 假设使用碰撞检测或其他方法确认是否靠近螺丝槽位 + // // 可以在此实现实际的检测逻辑 + // return true; // 简单返回true用于测试 + // } - private void StartRemoveScrew() - { - // 螺丝旋转动画 - transform.DORotate(new Vector3(0, 0, -90), 0.5f, RotateMode.LocalAxisAdd).OnComplete(() => - { - rotationCount++; - if (rotationCount >= requiredRotations) - { - RemoveScrew(); - } - }); - } + // private void StartRemoveScrew() + // { + // // 螺丝旋转动画 + // transform.DORotate(new Vector3(0, 0, -90), 0.5f, RotateMode.LocalAxisAdd).OnComplete(() => + // { + // rotationCount++; + // if (rotationCount >= requiredRotations) + // { + // RemoveScrew(); + // } + // }); + // } - private void RemoveScrew() - { - Debug.Log("Screw removed"); - rotationCount = 0; - // 可以加入螺丝掉落的逻辑,比如销毁对象或改变其状态 - } + // private void RemoveScrew() + // { + // Debug.Log("Screw removed"); + // rotationCount = 0; + // // 可以加入螺丝掉落的逻辑,比如销毁对象或改变其状态 + // } } diff --git a/Assets/Scripts/FixSystem/Tools/ScrewsManager.cs b/Assets/Scripts/FixSystem/Tools/ScrewsManager.cs new file mode 100644 index 000000000..a610d417e --- /dev/null +++ b/Assets/Scripts/FixSystem/Tools/ScrewsManager.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +public class ScrewsManager : MonoBehaviour +{ + public Module module; + + public void CheckAllScrews() + { + bool allDropped = true; + foreach (Transform screw in transform) + { + if (screw.gameObject.activeSelf) + { + allDropped = false; + break; + } + } + + if (allDropped) + { + module.EnableDragging(); + } + } +} diff --git a/Assets/Scripts/FixSystem/Tools/ScrewsManager.cs.meta b/Assets/Scripts/FixSystem/Tools/ScrewsManager.cs.meta new file mode 100644 index 000000000..de4b2a8be --- /dev/null +++ b/Assets/Scripts/FixSystem/Tools/ScrewsManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a545dd5c61ba4f44a644918c03adc3b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/FixSystem/Tools/Tool.cs b/Assets/Scripts/FixSystem/Tools/Tool.cs index 0ab583304..36e368a5c 100644 --- a/Assets/Scripts/FixSystem/Tools/Tool.cs +++ b/Assets/Scripts/FixSystem/Tools/Tool.cs @@ -6,6 +6,7 @@ using UnityEngine; public abstract class Tool : MonoBehaviour { //public string toolName; + public Vector3 offset; protected bool isFollowingMouse = false; public bool IsFollowingMouse => isFollowingMouse; // 只读属性 diff --git a/Assets/Scripts/FixSystem/Tools/ToolManager.cs b/Assets/Scripts/FixSystem/Tools/ToolManager.cs index 0d40ad7a2..4bbec6192 100644 --- a/Assets/Scripts/FixSystem/Tools/ToolManager.cs +++ b/Assets/Scripts/FixSystem/Tools/ToolManager.cs @@ -6,6 +6,7 @@ using UnityEngine.UI; public class ToolManager : MonoBehaviour { + public static ToolManager Instance { get; private set; } public GameObject toolBox; // 工具盒的UI对象 private Tool currentTool; public List toolPrefabs; @@ -14,6 +15,22 @@ public class ToolManager : MonoBehaviour public Canvas toolCanvas; private bool isBoxShow = false; + public bool HasTool => currentTool != null; // 判断玩家是否已获得工具 + + private void Awake() + { + // 确保 ToolManager 只有一个实例,并且这个实例是唯一的 + if (Instance != null && Instance != this) + { + Destroy(gameObject); // 如果实例已经存在,销毁当前实例 + } + else + { + Instance = this; // 保持唯一实例 + //DontDestroyOnLoad(gameObject); // 不销毁这个工具管理器 + } + } + private void Start() { toolBox.SetActive(false); // 初始隐藏工具盒 @@ -28,16 +45,14 @@ public class ToolManager : MonoBehaviour } } } - public void EnterFixMode(string moduleName) + public void TryStartRepairMode(Module module) { - Debug.Log($"Entering fix mode for module: {moduleName}"); - - if (currentTool != null && currentTool is Screwdriver screwdriver) + // 如果当前工具是螺丝刀,调用Module的EnterRepairMode方法 + if (currentTool is Screwdriver) { - screwdriver.StartFixMode(); // 调用螺丝刀进入维修状态 + module.StartRepairIfToolIsScrewdriver(currentTool); } } - public void ShowTool(string toolName) { if (toolPrefabDictionary.TryGetValue(toolName, out GameObject toolPrefab)) @@ -99,7 +114,7 @@ public class ToolManager : MonoBehaviour toolBox.SetActive(true); isBoxShow = true; - toolBox.transform.DOMoveY(-4f, 0.5f).SetEase(Ease.OutBounce); + toolBox.transform.DOMoveY(-3.7f, 0.5f).SetEase(Ease.OutBounce); // 为工具盒添加一次性点击事件 AddToolBoxReturnEvent(); @@ -129,7 +144,7 @@ public class ToolManager : MonoBehaviour public void HideTool() { - toolBox.transform.DOMoveY(-6f, 0.5f).SetEase(Ease.InBack).OnComplete(() => + toolBox.transform.DOMoveY(-6.3f, 0.5f).SetEase(Ease.InBack).OnComplete(() => { toolBox.SetActive(false); isBoxShow = false; @@ -150,8 +165,11 @@ public class ToolManager : MonoBehaviour { if (currentTool != null && currentTool.IsFollowingMouse) { + //Vector2 imageSize = toolImage.rect.size; + //Cursor.visible = false; Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); - currentTool.transform.position = new Vector3(mousePos.x, mousePos.y, 0); + //Vector3 toolOffset=currentTool.offset; + currentTool.transform.position = new Vector3(mousePos.x+0.75f, mousePos.y+0.75f, 0); } if(Input.GetKeyDown(KeyCode.O)) { @@ -181,6 +199,7 @@ public void ReturnTool() currentTool = null; HideTool(); + //Cursor.visible = true; } }