From acd8282ff01d6edaf7bc2b895aa3851523a6b024 Mon Sep 17 00:00:00 2001 From: GanX <2423855310@qq.com> Date: Wed, 22 Oct 2025 11:32:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(Console=20MovePlateform):=20=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E6=8E=A7=E5=88=B6=E5=8F=B0=E5=92=8C=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Prefab/Gameplay/Console.prefab | 243 ++++++++++++++++++ Assets/Prefab/Gameplay/Console.prefab.meta | 7 + Assets/Prefab/Gameplay/MovingPlatform.prefab | 202 +++++++++++++++ .../Gameplay/MovingPlatform.prefab.meta | 7 + Assets/Scenes/Test.unity | 155 +++++++++++ .../Script/Gameplay/Connect/ConnectionLine.cs | 4 +- .../Script/Gameplay/Connect/IConnectable.cs | 4 +- .../Gameplay/Connect/ISignalReceiver.cs | 8 + .../Gameplay/Connect/ISignalReceiver.cs.meta | 11 + .../Gameplay/Edit/BaseFacilityController.cs | 70 +++++ .../Edit/BaseFacilityController.cs.meta | 11 + .../Gameplay/Edit/ButtonInteractController.cs | 17 +- .../Edit/ColliderEditableController.cs | 2 +- .../Script/Gameplay/Edit/ConsoleController.cs | 109 ++++++++ .../Gameplay/Edit/ConsoleController.cs.meta | 3 + .../Gameplay/Edit/DoorInteractController.cs | 6 +- .../Script/Gameplay/Edit/EmitterController.cs | 7 +- .../Gameplay/Edit/LeverInteractController.cs | 6 +- .../Gameplay/Edit/MovingPlatformController.cs | 66 +++++ .../Edit/MovingPlatformController.cs.meta | 3 + .../Gameplay/Edit/NumberSlotController.cs | 3 +- .../Gameplay/Edit/PressurePlateController.cs | 6 +- .../Edit/RigidbodyEditableController.cs | 2 +- Assets/Script/Gameplay/Interface/IEditable.cs | 16 -- .../Gameplay/Interface/IEditable.cs.meta | 3 - .../Player/PlayerConnectController.cs | 7 +- .../Gameplay/UI/EditableComponentViewer.cs | 4 +- 27 files changed, 936 insertions(+), 46 deletions(-) create mode 100644 Assets/Prefab/Gameplay/Console.prefab create mode 100644 Assets/Prefab/Gameplay/Console.prefab.meta create mode 100644 Assets/Prefab/Gameplay/MovingPlatform.prefab create mode 100644 Assets/Prefab/Gameplay/MovingPlatform.prefab.meta create mode 100644 Assets/Script/Gameplay/Connect/ISignalReceiver.cs create mode 100644 Assets/Script/Gameplay/Connect/ISignalReceiver.cs.meta create mode 100644 Assets/Script/Gameplay/Edit/BaseFacilityController.cs create mode 100644 Assets/Script/Gameplay/Edit/BaseFacilityController.cs.meta create mode 100644 Assets/Script/Gameplay/Edit/ConsoleController.cs create mode 100644 Assets/Script/Gameplay/Edit/ConsoleController.cs.meta create mode 100644 Assets/Script/Gameplay/Edit/MovingPlatformController.cs create mode 100644 Assets/Script/Gameplay/Edit/MovingPlatformController.cs.meta delete mode 100644 Assets/Script/Gameplay/Interface/IEditable.cs delete mode 100644 Assets/Script/Gameplay/Interface/IEditable.cs.meta diff --git a/Assets/Prefab/Gameplay/Console.prefab b/Assets/Prefab/Gameplay/Console.prefab new file mode 100644 index 0000000..b74856c --- /dev/null +++ b/Assets/Prefab/Gameplay/Console.prefab @@ -0,0 +1,243 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4251861204989412305 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3847687401012981401} + - component: {fileID: 2162166433128526064} + - component: {fileID: 6287391807755848414} + - component: {fileID: 1340299133424398822} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3847687401012981401 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4251861204989412305} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.48, z: 0} + m_LocalScale: {x: 0.47, y: 0.47, z: 0.47} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 40184683368772887} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &2162166433128526064 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4251861204989412305} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6287391807755848414 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4251861204989412305} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &1340299133424398822 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4251861204989412305} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &6268190613584218029 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 40184683368772887} + - component: {fileID: 1110420076251542018} + - component: {fileID: 7064225343024974110} + - component: {fileID: 5726275595451979230} + - component: {fileID: 799695989745071872} + - component: {fileID: 3535959014221630543} + m_Layer: 0 + m_Name: Console + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &40184683368772887 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6268190613584218029} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 25, y: 0.8, z: -5} + m_LocalScale: {x: -0.51, y: 0.8, z: 0.46} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3847687401012981401} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1110420076251542018 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6268190613584218029} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7064225343024974110 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6268190613584218029} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &5726275595451979230 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6268190613584218029} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &799695989745071872 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6268190613584218029} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2791e039b8344f45ad6dc86f5188d82d, type: 3} + m_Name: + m_EditorClassIdentifier: + isActive: 1 +--- !u!114 &3535959014221630543 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6268190613584218029} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cc0b1376aefb4cccb530717966b48bf5, type: 3} + m_Name: + m_EditorClassIdentifier: + needSignalCount: 2 + controlTarget: {fileID: 0} + IsActive: 0 diff --git a/Assets/Prefab/Gameplay/Console.prefab.meta b/Assets/Prefab/Gameplay/Console.prefab.meta new file mode 100644 index 0000000..756389a --- /dev/null +++ b/Assets/Prefab/Gameplay/Console.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 85652dd0e36597644aa5b3bc9603797b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab/Gameplay/MovingPlatform.prefab b/Assets/Prefab/Gameplay/MovingPlatform.prefab new file mode 100644 index 0000000..3208cc5 --- /dev/null +++ b/Assets/Prefab/Gameplay/MovingPlatform.prefab @@ -0,0 +1,202 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2516956888757501734 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1739532496000538932} + m_Layer: 0 + m_Name: TargetPosition + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1739532496000538932 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2516956888757501734} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 10, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7628753614903997363} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3154147150921727065 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3671551312767422718} + m_Layer: 0 + m_Name: StartPosition + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3671551312767422718 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3154147150921727065} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7628753614903997363} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7005547257201551238 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7628753614903997363} + - component: {fileID: 5433797564514499876} + - component: {fileID: 8156633707813737306} + - component: {fileID: 3675454749213569031} + - component: {fileID: 1931740156992591536} + - component: {fileID: 7403824303730881351} + m_Layer: 0 + m_Name: MovingPlatform + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7628753614903997363 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7005547257201551238} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 25, y: 1, z: 0} + m_LocalScale: {x: 5, y: 0.5, z: 5} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3671551312767422718} + - {fileID: 1739532496000538932} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &5433797564514499876 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7005547257201551238} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8156633707813737306 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7005547257201551238} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &3675454749213569031 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7005547257201551238} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &1931740156992591536 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7005547257201551238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2791e039b8344f45ad6dc86f5188d82d, type: 3} + m_Name: + m_EditorClassIdentifier: + isActive: 1 +--- !u!114 &7403824303730881351 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7005547257201551238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 115d4e847c444833bc8dce4a03a78e55, type: 3} + m_Name: + m_EditorClassIdentifier: + MoveNeedSignalCount: 1 + startPositionObject: {fileID: 3154147150921727065} + targetPositionObject: {fileID: 2516956888757501734} + moveSpeed: 2 diff --git a/Assets/Prefab/Gameplay/MovingPlatform.prefab.meta b/Assets/Prefab/Gameplay/MovingPlatform.prefab.meta new file mode 100644 index 0000000..b396188 --- /dev/null +++ b/Assets/Prefab/Gameplay/MovingPlatform.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5ee760c56bad73f48a453ce5657e05b8 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Test.unity b/Assets/Scenes/Test.unity index 286bede..53b03ac 100644 --- a/Assets/Scenes/Test.unity +++ b/Assets/Scenes/Test.unity @@ -1287,6 +1287,79 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: b259f2c2ad8200d49b8ba9163724d69a, type: 3} +--- !u!1001 &730184548946979397 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 40184683368772887, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: m_LocalPosition.x + value: 25 + objectReference: {fileID: 0} + - target: {fileID: 40184683368772887, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 40184683368772887, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: m_LocalPosition.z + value: -5 + objectReference: {fileID: 0} + - target: {fileID: 40184683368772887, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 40184683368772887, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 40184683368772887, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 40184683368772887, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 40184683368772887, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 40184683368772887, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 40184683368772887, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535959014221630543, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: controlTarget + value: + objectReference: {fileID: 2578337202726380612} + - target: {fileID: 6268190613584218029, guid: 85652dd0e36597644aa5b3bc9603797b, + type: 3} + propertyPath: m_Name + value: Console + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 85652dd0e36597644aa5b3bc9603797b, type: 3} --- !u!1001 &1035971231385273297 PrefabInstance: m_ObjectHideFlags: 0 @@ -1491,6 +1564,86 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: b3e24e2df98d14e4ebc08cc68c071afa, type: 3} +--- !u!1001 &2578337202726380610 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 7005547257201551238, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + propertyPath: m_Name + value: MovingPlatform + objectReference: {fileID: 0} + - target: {fileID: 7628753614903997363, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + propertyPath: m_LocalPosition.x + value: 25 + objectReference: {fileID: 0} + - target: {fileID: 7628753614903997363, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7628753614903997363, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7628753614903997363, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7628753614903997363, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7628753614903997363, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7628753614903997363, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7628753614903997363, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7628753614903997363, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7628753614903997363, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5ee760c56bad73f48a453ce5657e05b8, type: 3} +--- !u!114 &2578337202726380612 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 7403824303730881351, guid: 5ee760c56bad73f48a453ce5657e05b8, + type: 3} + m_PrefabInstance: {fileID: 2578337202726380610} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 115d4e847c444833bc8dce4a03a78e55, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &3372472533242412945 PrefabInstance: m_ObjectHideFlags: 0 @@ -1933,6 +2086,7 @@ SceneRoots: - {fileID: 993640446} - {fileID: 2032802597} - {fileID: 4550639332017178188} + - {fileID: 2578337202726380610} - {fileID: 1781028406820323425} - {fileID: 1035971231385273297} - {fileID: 366996911271636373} @@ -1942,4 +2096,5 @@ SceneRoots: - {fileID: 865274353} - {fileID: 6350903300567888677} - {fileID: 1549323716} + - {fileID: 730184548946979397} - {fileID: 3372472533242412945} diff --git a/Assets/Script/Gameplay/Connect/ConnectionLine.cs b/Assets/Script/Gameplay/Connect/ConnectionLine.cs index 4659769..6850fcd 100644 --- a/Assets/Script/Gameplay/Connect/ConnectionLine.cs +++ b/Assets/Script/Gameplay/Connect/ConnectionLine.cs @@ -60,11 +60,11 @@ namespace Script.Gameplay.Connect { if (sender == _pointA.GetGameObject()) { - _pointB.SignalActive(active, sender); + _pointB.OnSignalReceived(active, sender); } else if (sender == _pointB.GetGameObject()) { - _pointA.SignalActive(active, sender); + _pointA.OnSignalReceived(active, sender); } } } diff --git a/Assets/Script/Gameplay/Connect/IConnectable.cs b/Assets/Script/Gameplay/Connect/IConnectable.cs index 5cfab6e..687fd00 100644 --- a/Assets/Script/Gameplay/Connect/IConnectable.cs +++ b/Assets/Script/Gameplay/Connect/IConnectable.cs @@ -3,14 +3,14 @@ using System.Collections.Generic; namespace Script.Gameplay.Connect { - public interface IConnectable + public interface IConnectable : ISignalReceiver { + public bool IsEnablePlayerConnect { get; set; } void OnGazeEnter(); // 玩家开始注视时触发 void OnGazeExit(); // 玩家停止注视时触发 Vector3 GetPosition(); // 获取连接点位置 GameObject GetGameObject(); // 获取连接点物体 string GetConnectableName(); // 获取连接点名称 public List ConnectionLines { get; set; } - void SignalActive(bool active, GameObject sender); // 被激活 } } \ No newline at end of file diff --git a/Assets/Script/Gameplay/Connect/ISignalReceiver.cs b/Assets/Script/Gameplay/Connect/ISignalReceiver.cs new file mode 100644 index 0000000..959edd0 --- /dev/null +++ b/Assets/Script/Gameplay/Connect/ISignalReceiver.cs @@ -0,0 +1,8 @@ +using UnityEngine; +namespace Script.Gameplay.Connect +{ + public interface ISignalReceiver + { + public void OnSignalReceived(bool active, GameObject sender); + } +} \ No newline at end of file diff --git a/Assets/Script/Gameplay/Connect/ISignalReceiver.cs.meta b/Assets/Script/Gameplay/Connect/ISignalReceiver.cs.meta new file mode 100644 index 0000000..7cc585e --- /dev/null +++ b/Assets/Script/Gameplay/Connect/ISignalReceiver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 83ece445f7f45404a9691aad6196f2cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/Gameplay/Edit/BaseFacilityController.cs b/Assets/Script/Gameplay/Edit/BaseFacilityController.cs new file mode 100644 index 0000000..9c2d80a --- /dev/null +++ b/Assets/Script/Gameplay/Edit/BaseFacilityController.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; +using Script.Gameplay.Connect; +using Script.Gameplay.Interface; +using UnityEngine; +public class BaseFacilityController : MonoBehaviour, IInteractable, IEditableComponent, IConnectable, ISignalSender +{ + public bool IsEnablePlayerConnect { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + public List ConnectionLines { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + public bool IsEnableActive { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + public bool IsEnableEdit { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + bool IEditableComponent.IsComponentActive { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + string IEditableComponent.ComponentName { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + + LockLevel IEditableComponent.LockLevel => throw new System.NotImplementedException(); + + public string GetConnectableName() + { + throw new System.NotImplementedException(); + } + + public GameObject GetGameObject() + { + throw new System.NotImplementedException(); + } + + public string GetInteractPrompt() + { + throw new System.NotImplementedException(); + } + + public Vector3 GetPosition() + { + throw new System.NotImplementedException(); + } + + public void Interact(GameObject interactor) + { + throw new System.NotImplementedException(); + } + + public void OnGazeEnter(GameObject editor) + { + throw new System.NotImplementedException(); + } + + public void OnGazeEnter() + { + throw new System.NotImplementedException(); + } + + public void OnGazeExit(GameObject editor) + { + throw new System.NotImplementedException(); + } + + public void OnGazeExit() + { + throw new System.NotImplementedException(); + } + + public void OnSignalReceived(bool active, GameObject sender) + { + throw new System.NotImplementedException(); + } + + public void SendSignal(bool active) + { + throw new System.NotImplementedException(); + } +} \ No newline at end of file diff --git a/Assets/Script/Gameplay/Edit/BaseFacilityController.cs.meta b/Assets/Script/Gameplay/Edit/BaseFacilityController.cs.meta new file mode 100644 index 0000000..633606d --- /dev/null +++ b/Assets/Script/Gameplay/Edit/BaseFacilityController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8e9f3dfa12a48a74ab978e8c7c8cb0af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/Gameplay/Edit/ButtonInteractController.cs b/Assets/Script/Gameplay/Edit/ButtonInteractController.cs index 766eb6a..212f58f 100644 --- a/Assets/Script/Gameplay/Edit/ButtonInteractController.cs +++ b/Assets/Script/Gameplay/Edit/ButtonInteractController.cs @@ -6,7 +6,8 @@ using Script.Gameplay.Connect; namespace Script.Gameplay.Edit { - public class ButtonInteractController : MonoBehaviour, IInteractable, IEditableComponent, IConnectable, ISignalSender + public class ButtonInteractController : MonoBehaviour, IInteractable, IEditableComponent, IConnectable, + ISignalSender { #region Interactable @@ -40,7 +41,7 @@ namespace Script.Gameplay.Edit SendSignal(true); Interactable = false; // 按钮压下的动画或效果可以在这里添加 - + yield return new WaitForSeconds(signalDuration); SendSignal(false); Interactable = true; @@ -53,7 +54,7 @@ namespace Script.Gameplay.Edit [SerializeField] private bool isActive = true; - public bool IsEditableActive + public bool IsComponentActive { get => isActive; set @@ -70,6 +71,8 @@ namespace Script.Gameplay.Edit #region Connectable + public bool IsEnablePlayerConnect { get; set; } = true; + public void OnGazeEnter() { } @@ -94,11 +97,12 @@ namespace Script.Gameplay.Edit } public List ConnectionLines { get; set; } = new List(); - public void SignalActive(bool active, GameObject sender) + + public void OnSignalReceived(bool active, GameObject sender) { // 按钮通常不接收信号,因此这里可以留空 } - + public void SendSignal(bool active) { if (ConnectionLines != null) @@ -112,5 +116,4 @@ namespace Script.Gameplay.Edit #endregion } -} - +} \ No newline at end of file diff --git a/Assets/Script/Gameplay/Edit/ColliderEditableController.cs b/Assets/Script/Gameplay/Edit/ColliderEditableController.cs index 5e7fd1f..b9ba483 100644 --- a/Assets/Script/Gameplay/Edit/ColliderEditableController.cs +++ b/Assets/Script/Gameplay/Edit/ColliderEditableController.cs @@ -8,7 +8,7 @@ namespace Script.Gameplay.Edit { [SerializeField] private bool isActive = true; - public bool IsEditableActive + public bool IsComponentActive { get => isActive; set diff --git a/Assets/Script/Gameplay/Edit/ConsoleController.cs b/Assets/Script/Gameplay/Edit/ConsoleController.cs new file mode 100644 index 0000000..32914e1 --- /dev/null +++ b/Assets/Script/Gameplay/Edit/ConsoleController.cs @@ -0,0 +1,109 @@ +using System.Collections.Generic; +using Script.Gameplay.Connect; +using Script.Gameplay.Interface; +using UnityEngine; + +namespace Script.Gameplay.Edit +{ + public class ConsoleController : MonoBehaviour, IConnectable, IEditableComponent, IInteractable + { + [SerializeField] private int needSignalCount = 1; + private int currentSignalCount; + [SerializeField] private MonoBehaviour controlTarget; + public ISignalReceiver controlTargetSignalReceiver; + [SerializeField] private bool IsActive; + private bool lastSendSignal = false; + + public bool IsComponentActive { get; set; } + private string componentName = "Console"; + public string ComponentName + { + get => string.IsNullOrEmpty(componentName) ? gameObject.name : componentName; + set => componentName = value; + } + + public LockLevel LockLevel { get; set; } + + public bool IsEnablePlayerConnect { get; set; } = true; + public List ConnectionLines { get; set; } = new List(); + + void Awake() + { + controlTargetSignalReceiver = controlTarget as ISignalReceiver; + if (controlTargetSignalReceiver == null) + { + Debug.LogError("Control target does not implement ISignalReceiver"); + } + } + + public void OnGazeEnter() + { + // no-op + } + + public void OnGazeExit() + { + // no-op + } + + public Vector3 GetPosition() + { + return this.gameObject.transform.position; + } + + public GameObject GetGameObject() + { + return gameObject; + } + + public string GetConnectableName() + { + return gameObject.name; + } + + public void OnSignalReceived(bool active, GameObject sender) + { + if (active) + { + currentSignalCount++; + } + else + { + currentSignalCount--; + } + if (currentSignalCount >= needSignalCount) + { + IsActive = true; + } + else + { + IsActive = false; + } + } + + public string GetInteractPrompt() + { + return "Interact to Active"; + } + + public void Interact(GameObject interactor) + { + if (IsActive && controlTargetSignalReceiver != null) + { + var signal = !lastSendSignal; + controlTargetSignalReceiver.OnSignalReceived(signal, this.gameObject); + lastSendSignal = signal; + } + } + + public void OnGazeEnter(GameObject editor) + { + // no-op + } + + public void OnGazeExit(GameObject editor) + { + // no-op + } + } +} diff --git a/Assets/Script/Gameplay/Edit/ConsoleController.cs.meta b/Assets/Script/Gameplay/Edit/ConsoleController.cs.meta new file mode 100644 index 0000000..b2b053c --- /dev/null +++ b/Assets/Script/Gameplay/Edit/ConsoleController.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: cc0b1376aefb4cccb530717966b48bf5 +timeCreated: 1761039706 \ No newline at end of file diff --git a/Assets/Script/Gameplay/Edit/DoorInteractController.cs b/Assets/Script/Gameplay/Edit/DoorInteractController.cs index 0f81ae0..e788c1e 100644 --- a/Assets/Script/Gameplay/Edit/DoorInteractController.cs +++ b/Assets/Script/Gameplay/Edit/DoorInteractController.cs @@ -64,7 +64,7 @@ namespace Script.Gameplay.Edit private bool isActive = true; - public bool IsEditableActive + public bool IsComponentActive { get => isActive; set @@ -82,6 +82,8 @@ namespace Script.Gameplay.Edit #region Connectable + public bool IsEnablePlayerConnect { get; set; } = true; + public void OnGazeEnter() { } @@ -106,7 +108,7 @@ namespace Script.Gameplay.Edit } public List ConnectionLines { get; set; } = new List(); - public void SignalActive(bool active, GameObject sender) + public void OnSignalReceived(bool active, GameObject sender) { Interact(sender); } diff --git a/Assets/Script/Gameplay/Edit/EmitterController.cs b/Assets/Script/Gameplay/Edit/EmitterController.cs index 8f81e7b..9082a23 100644 --- a/Assets/Script/Gameplay/Edit/EmitterController.cs +++ b/Assets/Script/Gameplay/Edit/EmitterController.cs @@ -21,12 +21,13 @@ namespace Script.Gameplay.Edit // 不可交互 // 可编辑 - public bool IsEditableActive { get; set; } = true; + public bool IsComponentActive { get; set; } = true; public string ComponentName { get; set; } = "Emitter"; public LockLevel LockLevel => LockLevel.Red; // 可连线 public List ConnectionLines { get; set; } = new List(); + public bool IsEnablePlayerConnect { get; set; } = true; public void OnGazeEnter() { } public void OnGazeExit() { } public Vector3 GetPosition() => transform.position; @@ -34,9 +35,9 @@ namespace Script.Gameplay.Edit public string GetConnectableName() => gameObject.name; // 接收信号 - public void SignalActive(bool active, GameObject sender) + public void OnSignalReceived(bool active, GameObject sender) { - if(!IsEditableActive) return; + if(!IsComponentActive) return; if (active) { if (emitCoroutine == null) diff --git a/Assets/Script/Gameplay/Edit/LeverInteractController.cs b/Assets/Script/Gameplay/Edit/LeverInteractController.cs index 545b21e..f19c6cf 100644 --- a/Assets/Script/Gameplay/Edit/LeverInteractController.cs +++ b/Assets/Script/Gameplay/Edit/LeverInteractController.cs @@ -42,7 +42,7 @@ namespace Script.Gameplay.Edit [SerializeField] private bool isActive = true; - public bool IsEditableActive + public bool IsComponentActive { get => isActive; set @@ -59,6 +59,8 @@ namespace Script.Gameplay.Edit #region Connectable + public bool IsEnablePlayerConnect { get; set; } = true; + public void OnGazeEnter() { } @@ -76,7 +78,7 @@ namespace Script.Gameplay.Edit public string GetConnectableName() => gameObject.name; public List ConnectionLines { get; set; }= new List(); - public void SignalActive(bool active, GameObject sender) + public void OnSignalReceived(bool active, GameObject sender) { // } diff --git a/Assets/Script/Gameplay/Edit/MovingPlatformController.cs b/Assets/Script/Gameplay/Edit/MovingPlatformController.cs new file mode 100644 index 0000000..7239843 --- /dev/null +++ b/Assets/Script/Gameplay/Edit/MovingPlatformController.cs @@ -0,0 +1,66 @@ +using UnityEngine; +using Script.Gameplay.Connect; +using Script.Gameplay.Interface; + +namespace Script.Gameplay.Edit +{ + public class MovingPlatformController : MonoBehaviour, IEditableComponent, ISignalReceiver + { + [SerializeField] private GameObject startPositionObject; + [SerializeField] private GameObject targetPositionObject; + public float moveSpeed = 2f; + private Vector3 startPosition; + private Vector3 targetPosition; + + private bool isMoving = false; + private bool forward = true; + + private void Awake() + { + startPosition = startPositionObject.transform.position; + targetPosition = targetPositionObject.transform.position; + transform.position = startPosition; + } + + private void Update() + { + if (!isMoving) return; + + Vector3 destination = forward ? targetPosition : startPosition; + transform.position = Vector3.MoveTowards(transform.position, destination, moveSpeed * Time.deltaTime); + + if (Vector3.Distance(transform.position, destination) < 0.01f) + { + forward = !forward; + } + } + + public void OnSignalReceived(bool active, GameObject sender) + { + if (active) + { + isMoving = true; + } + else + { + isMoving = false; + } + } + + // IEditableComponent + private bool isEditable = true; + public bool IsComponentActive + { + get => isEditable; + set + { + isEditable = value; + isMoving = value; + } + } + + public string ComponentName { get; set; } = "MovingPlatform"; + public LockLevel LockLevel => LockLevel.Red; + } +} + diff --git a/Assets/Script/Gameplay/Edit/MovingPlatformController.cs.meta b/Assets/Script/Gameplay/Edit/MovingPlatformController.cs.meta new file mode 100644 index 0000000..832bbda --- /dev/null +++ b/Assets/Script/Gameplay/Edit/MovingPlatformController.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 115d4e847c444833bc8dce4a03a78e55 +timeCreated: 1761038093 \ No newline at end of file diff --git a/Assets/Script/Gameplay/Edit/NumberSlotController.cs b/Assets/Script/Gameplay/Edit/NumberSlotController.cs index 6658ad6..6b704a0 100644 --- a/Assets/Script/Gameplay/Edit/NumberSlotController.cs +++ b/Assets/Script/Gameplay/Edit/NumberSlotController.cs @@ -31,6 +31,7 @@ namespace Script.Gameplay.Edit // 不可编辑,不可交互 // 可连接,可发信号 + public bool IsEnablePlayerConnect { get; set; } = true; public void OnGazeEnter() { } public void OnGazeExit() { } public Vector3 GetPosition() => transform.position; @@ -38,7 +39,7 @@ namespace Script.Gameplay.Edit public string GetConnectableName() => gameObject.name; // 接收信号 - public void SignalActive(bool active, GameObject sender) + public void OnSignalReceived(bool active, GameObject sender) { if (active) { diff --git a/Assets/Script/Gameplay/Edit/PressurePlateController.cs b/Assets/Script/Gameplay/Edit/PressurePlateController.cs index 0818bdf..ad8a576 100644 --- a/Assets/Script/Gameplay/Edit/PressurePlateController.cs +++ b/Assets/Script/Gameplay/Edit/PressurePlateController.cs @@ -28,7 +28,7 @@ namespace Script.Gameplay.Edit #region EditableComponent - public bool IsEditableActive + public bool IsComponentActive { get => isActive; set => isActive = value; @@ -41,6 +41,8 @@ namespace Script.Gameplay.Edit #region Connectable + public bool IsEnablePlayerConnect { get; set; } = true; + public void OnGazeEnter() { } @@ -59,7 +61,7 @@ namespace Script.Gameplay.Edit public string GetConnectableName() => gameObject.name; public List ConnectionLines { get; set; } = new List(); - public void SignalActive(bool active, GameObject sender) + public void OnSignalReceived(bool active, GameObject sender) { // } diff --git a/Assets/Script/Gameplay/Edit/RigidbodyEditableController.cs b/Assets/Script/Gameplay/Edit/RigidbodyEditableController.cs index 396418f..d21d02b 100644 --- a/Assets/Script/Gameplay/Edit/RigidbodyEditableController.cs +++ b/Assets/Script/Gameplay/Edit/RigidbodyEditableController.cs @@ -8,7 +8,7 @@ namespace Script.Gameplay.Edit { [SerializeField] private bool isActive = true; - public bool IsEditableActive + public bool IsComponentActive { get => isActive; set diff --git a/Assets/Script/Gameplay/Interface/IEditable.cs b/Assets/Script/Gameplay/Interface/IEditable.cs deleted file mode 100644 index 768ed48..0000000 --- a/Assets/Script/Gameplay/Interface/IEditable.cs +++ /dev/null @@ -1,16 +0,0 @@ -using UnityEngine; -using Script.Gameplay.Player; -using System.Collections.Generic; -// using Script.Gameplay.Facility; - -namespace Script.Gameplay.Interface -{ - // public interface IEditable - // { - // void OnGazeEnter(PlayerEditController editor); // 玩家开始注视时触发 - // void OnGazeExit(PlayerEditController editor); // 玩家停止注视时触发 - // void BeginEdit(); - // void EndEdit(); - // List GetEditableComponents(); - // } -} \ No newline at end of file diff --git a/Assets/Script/Gameplay/Interface/IEditable.cs.meta b/Assets/Script/Gameplay/Interface/IEditable.cs.meta deleted file mode 100644 index ac65dc3..0000000 --- a/Assets/Script/Gameplay/Interface/IEditable.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8a22b94dcb1d4eb78b7b07ebd8967dc6 -timeCreated: 1760629255 \ No newline at end of file diff --git a/Assets/Script/Gameplay/Player/PlayerConnectController.cs b/Assets/Script/Gameplay/Player/PlayerConnectController.cs index 343ce03..7bc5668 100644 --- a/Assets/Script/Gameplay/Player/PlayerConnectController.cs +++ b/Assets/Script/Gameplay/Player/PlayerConnectController.cs @@ -110,7 +110,8 @@ namespace Script.Gameplay.Player public void SetPointA(IConnectable target) { if (target == null) return; - if(!IsEnableConnecting) return; + if (!IsEnableConnecting) return; + if (!target.IsEnablePlayerConnect) return; outTarget = target; OnSetPointA?.Invoke(outTarget); } @@ -118,7 +119,9 @@ namespace Script.Gameplay.Player public void SetPointB(IConnectable target) { if (target == null) return; - if(!IsEnableConnecting) return; + if (!IsEnableConnecting) return; + if (!target.IsEnablePlayerConnect) return; + inputTarget = target; OnSetPointB?.Invoke(inputTarget); } diff --git a/Assets/Script/Gameplay/UI/EditableComponentViewer.cs b/Assets/Script/Gameplay/UI/EditableComponentViewer.cs index 1fe6d61..a802d0f 100644 --- a/Assets/Script/Gameplay/UI/EditableComponentViewer.cs +++ b/Assets/Script/Gameplay/UI/EditableComponentViewer.cs @@ -24,7 +24,7 @@ namespace UI private void OnClickButton() { - _component.IsEditableActive = !_component.IsEditableActive; + _component.IsComponentActive = !_component.IsComponentActive; RefreshUI(); } @@ -33,7 +33,7 @@ namespace UI if (_component != null) { componentName.text = _component.ComponentName; - componentState.text = _component.IsEditableActive ? "Active" : "Inactive"; + componentState.text = _component.IsComponentActive ? "Active" : "Inactive"; } } }