feat(Console MovePlateform): 实现控制台和移动平台

This commit is contained in:
2025-10-22 11:32:53 +08:00
parent 3d014cd2c2
commit 3cdd41ea49
27 changed files with 936 additions and 46 deletions

View File

@@ -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

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 85652dd0e36597644aa5b3bc9603797b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5ee760c56bad73f48a453ce5657e05b8
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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}

View File

@@ -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);
}
}
}

View File

@@ -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<ConnectionLine> ConnectionLines { get; set; }
void SignalActive(bool active, GameObject sender); // 被激活
}
}

View File

@@ -0,0 +1,8 @@
using UnityEngine;
namespace Script.Gameplay.Connect
{
public interface ISignalReceiver
{
public void OnSignalReceived(bool active, GameObject sender);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 83ece445f7f45404a9691aad6196f2cb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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<ConnectionLine> 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();
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8e9f3dfa12a48a74ab978e8c7c8cb0af
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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<ConnectionLine> ConnectionLines { get; set; } = new List<ConnectionLine>();
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
}
}
}

View File

@@ -8,7 +8,7 @@ namespace Script.Gameplay.Edit
{
[SerializeField] private bool isActive = true;
public bool IsEditableActive
public bool IsComponentActive
{
get => isActive;
set

View File

@@ -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<ConnectionLine> ConnectionLines { get; set; } = new List<ConnectionLine>();
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
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: cc0b1376aefb4cccb530717966b48bf5
timeCreated: 1761039706

View File

@@ -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<ConnectionLine> ConnectionLines { get; set; } = new List<ConnectionLine>();
public void SignalActive(bool active, GameObject sender)
public void OnSignalReceived(bool active, GameObject sender)
{
Interact(sender);
}

View File

@@ -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<ConnectionLine> ConnectionLines { get; set; } = new List<ConnectionLine>();
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)

View File

@@ -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<ConnectionLine> ConnectionLines { get; set; }= new List<ConnectionLine>();
public void SignalActive(bool active, GameObject sender)
public void OnSignalReceived(bool active, GameObject sender)
{
//
}

View File

@@ -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;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 115d4e847c444833bc8dce4a03a78e55
timeCreated: 1761038093

View File

@@ -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)
{

View File

@@ -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<ConnectionLine> ConnectionLines { get; set; } = new List<ConnectionLine>();
public void SignalActive(bool active, GameObject sender)
public void OnSignalReceived(bool active, GameObject sender)
{
//
}

View File

@@ -8,7 +8,7 @@ namespace Script.Gameplay.Edit
{
[SerializeField] private bool isActive = true;
public bool IsEditableActive
public bool IsComponentActive
{
get => isActive;
set

View File

@@ -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<IEditableComponent> GetEditableComponents();
// }
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 8a22b94dcb1d4eb78b7b07ebd8967dc6
timeCreated: 1760629255

View File

@@ -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);
}

View File

@@ -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";
}
}
}