리플레이 기능 추가
리플레이 기능 추가했습니다
This commit is contained in:
parent
9f841c4828
commit
486fdbd829
|
|
@ -32,6 +32,15 @@
|
|||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
},
|
||||
{
|
||||
"name": "Retry",
|
||||
"type": "Button",
|
||||
"id": "4ddb1b7d-f6d1-4bcd-9076-e0efa8da05cf",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": false
|
||||
}
|
||||
],
|
||||
"bindings": [
|
||||
|
|
@ -89,6 +98,17 @@
|
|||
"action": "Hang",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "25ea5eb7-cba2-4557-8341-378b69e2c7f9",
|
||||
"path": "<Keyboard>/r",
|
||||
"interactions": "Press",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Retry",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
638
Assets/Prefabs/Ghost.prefab
Normal file
638
Assets/Prefabs/Ghost.prefab
Normal file
|
|
@ -0,0 +1,638 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1707114652842343072
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8354061827391739510}
|
||||
- component: {fileID: 8460095861745857899}
|
||||
- component: {fileID: 5965616281446492719}
|
||||
m_Layer: 6
|
||||
m_Name: Foot
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8354061827391739510
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1707114652842343072}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -0.41, z: 0}
|
||||
m_LocalScale: {x: 0.9, y: 0.2, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 809564794416131655}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &8460095861745857899
|
||||
SpriteRenderer:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1707114652842343072}
|
||||
m_Enabled: 0
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 1
|
||||
m_MaskInteraction: 0
|
||||
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||
m_Color: {r: 1, g: 0, b: 0, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!61 &5965616281446492719
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1707114652842343072}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 1
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 1, y: 1}
|
||||
newSize: {x: 1, y: 1}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &3258180423584828816
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2816430265647056345}
|
||||
- component: {fileID: 1775161611346932189}
|
||||
- component: {fileID: 567583971402532917}
|
||||
- component: {fileID: 7973836795863692992}
|
||||
m_Layer: 8
|
||||
m_Name: Head
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2816430265647056345
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3258180423584828816}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.45, z: 0}
|
||||
m_LocalScale: {x: 1, y: 0.1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 809564794416131655}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &1775161611346932189
|
||||
SpriteRenderer:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3258180423584828816}
|
||||
m_Enabled: 0
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 1
|
||||
m_MaskInteraction: 0
|
||||
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!61 &567583971402532917
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3258180423584828816}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 1
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 1, y: 1}
|
||||
newSize: {x: 1, y: 1}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!251 &7973836795863692992
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3258180423584828816}
|
||||
m_Enabled: 1
|
||||
m_UseColliderMask: 1
|
||||
m_ColliderMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 64
|
||||
m_RotationalOffset: 0
|
||||
m_UseOneWay: 1
|
||||
m_UseOneWayGrouping: 0
|
||||
m_SurfaceArc: 160
|
||||
m_UseSideFriction: 0
|
||||
m_UseSideBounce: 0
|
||||
m_SideArc: 1
|
||||
--- !u!1 &3340017133917094190
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1806536103398767836}
|
||||
- component: {fileID: 4853694680767308140}
|
||||
- component: {fileID: 1591313861624791812}
|
||||
m_Layer: 0
|
||||
m_Name: Hang
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1806536103398767836
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3340017133917094190}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0.6, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.2, y: 0.3, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 809564794416131655}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &4853694680767308140
|
||||
SpriteRenderer:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3340017133917094190}
|
||||
m_Enabled: 0
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 1
|
||||
m_MaskInteraction: 0
|
||||
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||
m_Color: {r: 0.14481235, g: 1, b: 0, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!61 &1591313861624791812
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3340017133917094190}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 1
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 1, y: 1}
|
||||
newSize: {x: 1, y: 1}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &3712568040866592016
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 809564794416131655}
|
||||
- component: {fileID: 4020000926523891927}
|
||||
- component: {fileID: 6688878933266579960}
|
||||
- component: {fileID: 2454460270082840082}
|
||||
- component: {fileID: 4635745398930316562}
|
||||
- component: {fileID: 2735959092271683024}
|
||||
m_Layer: 7
|
||||
m_Name: Ghost
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &809564794416131655
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3712568040866592016}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -5.44, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8354061827391739510}
|
||||
- {fileID: 1806536103398767836}
|
||||
- {fileID: 2816430265647056345}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &4020000926523891927
|
||||
SpriteRenderer:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3712568040866592016}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_MaskInteraction: 0
|
||||
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0.39215687}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!50 &6688878933266579960
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3712568040866592016}
|
||||
m_BodyType: 0
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
m_GravityScale: 1.75
|
||||
m_Material: {fileID: 6200000, guid: f404935b3489a20429821ec93144b14e, type: 2}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_Interpolate: 1
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 1
|
||||
m_Constraints: 4
|
||||
--- !u!61 &2454460270082840082
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3712568040866592016}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 1, y: 1}
|
||||
newSize: {x: 1, y: 1}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!114 &4635745398930316562
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3712568040866592016}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 29c0c00b93709f6448e26572f1a595f7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: '::'
|
||||
moveSpeed: 4
|
||||
jumpForce: 10
|
||||
groundCheckCollider: {fileID: 5965616281446492719}
|
||||
hangWallCheckCollider: {fileID: 1591313861624791812}
|
||||
groundLayer:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!114 &2735959092271683024
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3712568040866592016}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c09ecf193f2744843b3edfe2e6cade33, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::GhostController
|
||||
7
Assets/Prefabs/Ghost.prefab.meta
Normal file
7
Assets/Prefabs/Ghost.prefab.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f388a3dfece01ad40afc9a674871b6b8
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -14,7 +14,9 @@ GameObject:
|
|||
- component: {fileID: 3579431522946132784}
|
||||
- component: {fileID: 9183217660445491922}
|
||||
- component: {fileID: 7321184312672384639}
|
||||
m_Layer: 0
|
||||
- component: {fileID: 8421833920431841059}
|
||||
- component: {fileID: 6451460663909217518}
|
||||
m_Layer: 6
|
||||
m_Name: Player
|
||||
m_TagString: Player
|
||||
m_Icon: {fileID: 0}
|
||||
|
|
@ -188,7 +190,7 @@ MonoBehaviour:
|
|||
hangWallCheckCollider: {fileID: 6481877445078531268}
|
||||
groundLayer:
|
||||
serializedVersion: 2
|
||||
m_Bits: 8
|
||||
m_Bits: 264
|
||||
--- !u!114 &7321184312672384639
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -219,6 +221,30 @@ MonoBehaviour:
|
|||
m_DefaultActionMap: Player
|
||||
m_SplitScreenIndex: -1
|
||||
m_Camera: {fileID: 0}
|
||||
--- !u!114 &8421833920431841059
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 306704792185372058}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 60860e596b316904c9161faf50525139, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::PlayerController
|
||||
--- !u!114 &6451460663909217518
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 306704792185372058}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 982323cf88952734c8beeebfabfe5b5b, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::InputRecorder
|
||||
--- !u!1 &2569477875044198337
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -260,7 +286,7 @@ SpriteRenderer:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2569477875044198337}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
|
|
@ -368,7 +394,7 @@ GameObject:
|
|||
- component: {fileID: 3943275774170693834}
|
||||
- component: {fileID: 1456137351026860733}
|
||||
- component: {fileID: 5495617370377014515}
|
||||
m_Layer: 0
|
||||
m_Layer: 6
|
||||
m_Name: Foot
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
|
|
@ -385,7 +411,7 @@ Transform:
|
|||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -0.41, z: 0}
|
||||
m_LocalScale: {x: 1, y: 0.2, z: 1}
|
||||
m_LocalScale: {x: 0.9, y: 0.2, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7588602306031819191}
|
||||
|
|
@ -398,7 +424,7 @@ SpriteRenderer:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2757615747814713057}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
|
|
|
|||
|
|
@ -511,6 +511,84 @@ Transform:
|
|||
- {fileID: 2141050427}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1467073416
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1467073418}
|
||||
- component: {fileID: 1467073417}
|
||||
m_Layer: 0
|
||||
m_Name: RecordingManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1467073417
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1467073416}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 37140bdf17b0dcb4e9deaf1b3320b46c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::RecordingManager
|
||||
playerPrefab: {fileID: 306704792185372058, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
ghostPrefab: {fileID: 3712568040866592016, guid: f388a3dfece01ad40afc9a674871b6b8, type: 3}
|
||||
spawnPoint: {fileID: 1519150088}
|
||||
--- !u!4 &1467073418
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1467073416}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1519150087
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1519150088}
|
||||
m_Layer: 0
|
||||
m_Name: SpwanPoint
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1519150088
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1519150087}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -6, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &2141050424
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -649,68 +727,12 @@ Transform:
|
|||
m_Children: []
|
||||
m_Father: {fileID: 1346115797}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
|
||||
--- !u!1001 &5571299623736862962
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 306704792185372058, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Player
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7588602306031819191, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -5.44
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7588602306031819191, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7588602306031819191, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7588602306031819191, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7588602306031819191, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7588602306031819191, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7588602306031819191, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7588602306031819191, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7588602306031819191, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7588602306031819191, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: dd314a3f767a46446b652103ace62042, type: 3}
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 519420032}
|
||||
- {fileID: 619394802}
|
||||
- {fileID: 5571299623736862962}
|
||||
- {fileID: 1346115797}
|
||||
- {fileID: 1467073418}
|
||||
- {fileID: 1519150088}
|
||||
|
|
|
|||
73
Assets/Scripts/Player/PlayerController.cs
Normal file
73
Assets/Scripts/Player/PlayerController.cs
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public class PlayerController : MonoBehaviour
|
||||
{
|
||||
private PlayerMovement _playerMovement;
|
||||
private InputRecorder _inputRecorder;
|
||||
|
||||
private Vector2 moveInputBuffer;
|
||||
private bool jumpBuffer;
|
||||
private bool hangBuffer;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_playerMovement = GetComponent<PlayerMovement>();
|
||||
_inputRecorder = GetComponent<InputRecorder>();
|
||||
}
|
||||
|
||||
private void OnMove(InputValue value)
|
||||
{
|
||||
moveInputBuffer = value.Get<Vector2>();
|
||||
}
|
||||
|
||||
private void OnJump(InputValue value)
|
||||
{
|
||||
if (value.isPressed)
|
||||
{
|
||||
jumpBuffer = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnHang(InputValue value)
|
||||
{
|
||||
if (value.isPressed)
|
||||
{
|
||||
hangBuffer = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRetry(InputValue value)
|
||||
{
|
||||
if (value.isPressed)
|
||||
{
|
||||
RecordingManager.instance.StopPlayingRecord();
|
||||
}
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
InputFrame currentFrame = new InputFrame(moveInputBuffer.x, jumpBuffer, hangBuffer);
|
||||
|
||||
_inputRecorder?.Record(currentFrame);
|
||||
RunInput(currentFrame);
|
||||
|
||||
jumpBuffer = false;
|
||||
hangBuffer = false;
|
||||
}
|
||||
|
||||
private void RunInput(InputFrame frame)
|
||||
{
|
||||
_playerMovement.SetMoveInput(new Vector2(frame.moveX, 0));
|
||||
|
||||
if (frame.isJumpPressed)
|
||||
{
|
||||
_playerMovement.TryJump();
|
||||
}
|
||||
|
||||
if (frame.isHangPressed)
|
||||
{
|
||||
_playerMovement.TryHang();
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Player/PlayerController.cs.meta
Normal file
2
Assets/Scripts/Player/PlayerController.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 60860e596b316904c9161faf50525139
|
||||
|
|
@ -30,34 +30,31 @@ public class PlayerMovement : MonoBehaviour
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
HandleRotation();
|
||||
_rigidbody2D.linearVelocity = new Vector2(inputVector.x * moveSpeed, _rigidbody2D.linearVelocity.y);
|
||||
}
|
||||
|
||||
private void OnMove(InputValue value)
|
||||
public void SetMoveInput(Vector2 input)
|
||||
{
|
||||
inputVector = value.Get<Vector2>();
|
||||
inputVector = input;
|
||||
}
|
||||
|
||||
private void OnJump(InputValue value)
|
||||
{
|
||||
if (value.isPressed)
|
||||
public void TryJump()
|
||||
{
|
||||
Debug.Log(IsGrounded());
|
||||
if (isHanging)
|
||||
{
|
||||
CancelHanging();
|
||||
return;
|
||||
}
|
||||
|
||||
else if (IsGrounded())
|
||||
{
|
||||
_rigidbody2D.linearVelocity = new Vector2(_rigidbody2D.linearVelocity.x, jumpForce);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnHang(InputValue value)
|
||||
{
|
||||
if (value.isPressed)
|
||||
public void TryHang()
|
||||
{
|
||||
if (isHanging)
|
||||
{
|
||||
|
|
@ -68,7 +65,6 @@ public class PlayerMovement : MonoBehaviour
|
|||
HangingObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CancelHanging()
|
||||
{
|
||||
53
Assets/Scripts/Replay/GhostController.cs
Normal file
53
Assets/Scripts/Replay/GhostController.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class GhostController : MonoBehaviour
|
||||
{
|
||||
private PlayerMovement _playerMovement;
|
||||
private Queue<InputFrame> inputFrames;
|
||||
|
||||
private bool isPlaying = false;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_playerMovement = GetComponent<PlayerMovement>();
|
||||
}
|
||||
|
||||
public void Init(List<InputFrame> recordedData)
|
||||
{
|
||||
inputFrames = new Queue<InputFrame>(recordedData);
|
||||
isPlaying = true;
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (!isPlaying)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (inputFrames.Count > 0)
|
||||
{
|
||||
InputFrame frame = inputFrames.Dequeue();
|
||||
|
||||
_playerMovement.SetMoveInput(new Vector2(frame.moveX, 0));
|
||||
|
||||
if (frame.isJumpPressed)
|
||||
{
|
||||
_playerMovement.TryJump();
|
||||
}
|
||||
|
||||
if (frame.isHangPressed)
|
||||
{
|
||||
_playerMovement.TryHang();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_playerMovement.SetMoveInput(Vector2.zero);
|
||||
isPlaying = false;
|
||||
|
||||
// 제거할지 아니면 멈출지 고민해보기? ㅋㅋ
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Replay/GhostController.cs.meta
Normal file
2
Assets/Scripts/Replay/GhostController.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c09ecf193f2744843b3edfe2e6cade33
|
||||
16
Assets/Scripts/Replay/InputFrame.cs
Normal file
16
Assets/Scripts/Replay/InputFrame.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public struct InputFrame
|
||||
{
|
||||
public float moveX;
|
||||
public bool isJumpPressed;
|
||||
public bool isHangPressed;
|
||||
|
||||
public InputFrame(float moveX, bool isJumpPressed, bool isHangPressed)
|
||||
{
|
||||
this.moveX = moveX;
|
||||
this.isJumpPressed = isJumpPressed;
|
||||
this.isHangPressed = isHangPressed;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Replay/InputFrame.cs.meta
Normal file
2
Assets/Scripts/Replay/InputFrame.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 78ae81d5848ad8e4997b609d611525c1
|
||||
33
Assets/Scripts/Replay/InputRecorder.cs
Normal file
33
Assets/Scripts/Replay/InputRecorder.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class InputRecorder : MonoBehaviour
|
||||
{
|
||||
private Queue<InputFrame> recordingQueue = new Queue<InputFrame>();
|
||||
|
||||
private bool isRecording = false;
|
||||
|
||||
public void StartRecording()
|
||||
{
|
||||
recordingQueue.Clear();
|
||||
isRecording = true;
|
||||
}
|
||||
|
||||
public void StopRecording()
|
||||
{
|
||||
isRecording = false;
|
||||
}
|
||||
|
||||
public void Record(InputFrame inputFrame)
|
||||
{
|
||||
if (isRecording)
|
||||
{
|
||||
recordingQueue.Enqueue(inputFrame);
|
||||
}
|
||||
}
|
||||
|
||||
public List<InputFrame> GetInputFrames()
|
||||
{
|
||||
return new List<InputFrame>(recordingQueue);
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Replay/InputRecorder.cs.meta
Normal file
2
Assets/Scripts/Replay/InputRecorder.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 982323cf88952734c8beeebfabfe5b5b
|
||||
72
Assets/Scripts/Replay/RecordingManager.cs
Normal file
72
Assets/Scripts/Replay/RecordingManager.cs
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class RecordingManager : MonoBehaviour
|
||||
{
|
||||
public static RecordingManager instance;
|
||||
|
||||
[Header("프리팹 설정")]
|
||||
[SerializeField] private GameObject playerPrefab;
|
||||
[SerializeField] private GameObject ghostPrefab;
|
||||
|
||||
[Header("스폰 위치")]
|
||||
public Transform spawnPoint;
|
||||
|
||||
private List<List<InputFrame>> allRecordedFrames = new List<List<InputFrame>>();
|
||||
|
||||
private InputRecorder currentPlayerRecorder;
|
||||
private GameObject currentPlayer;
|
||||
private List<GameObject> ghostList = new List<GameObject>();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
PlayerAllRecord();
|
||||
}
|
||||
|
||||
public void PlayerAllRecord()
|
||||
{
|
||||
currentPlayer = Instantiate(playerPrefab, spawnPoint.position, Quaternion.identity);
|
||||
currentPlayerRecorder = currentPlayer.GetComponent<InputRecorder>();
|
||||
currentPlayerRecorder.StartRecording();
|
||||
|
||||
if (!(allRecordedFrames.Count > 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var record in allRecordedFrames)
|
||||
{
|
||||
GameObject ghost = Instantiate(ghostPrefab, spawnPoint.position, Quaternion.identity);
|
||||
ghostList.Add(ghost);
|
||||
ghost.GetComponent<GhostController>().Init(record);
|
||||
}
|
||||
}
|
||||
|
||||
public void StopPlayingRecord()
|
||||
{
|
||||
currentPlayerRecorder.StopRecording();
|
||||
List<InputFrame> inputFrames = currentPlayerRecorder.GetInputFrames();
|
||||
allRecordedFrames.Add(inputFrames);
|
||||
|
||||
Destroy(currentPlayer);
|
||||
|
||||
foreach (GameObject ghost in ghostList)
|
||||
{
|
||||
Destroy(ghost);
|
||||
}
|
||||
|
||||
Invoke("PlayerAllRecord", 1f);
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Replay/RecordingManager.cs.meta
Normal file
2
Assets/Scripts/Replay/RecordingManager.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 37140bdf17b0dcb4e9deaf1b3320b46c
|
||||
|
|
@ -3,12 +3,12 @@
|
|||
--- !u!19 &1
|
||||
Physics2DSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 5
|
||||
serializedVersion: 11
|
||||
m_Gravity: {x: 0, y: -9.81}
|
||||
m_DefaultMaterial: {fileID: 0}
|
||||
m_VelocityIterations: 8
|
||||
m_PositionIterations: 3
|
||||
m_VelocityThreshold: 1
|
||||
m_BounceThreshold: 1
|
||||
m_MaxLinearCorrection: 0.2
|
||||
m_MaxAngularCorrection: 8
|
||||
m_MaxTranslationSpeed: 100
|
||||
|
|
@ -19,6 +19,7 @@ Physics2DSettings:
|
|||
m_LinearSleepTolerance: 0.01
|
||||
m_AngularSleepTolerance: 2
|
||||
m_DefaultContactOffset: 0.01
|
||||
m_ContactThreshold: 0
|
||||
m_JobOptions:
|
||||
serializedVersion: 2
|
||||
useMultithreading: 0
|
||||
|
|
@ -39,18 +40,18 @@ Physics2DSettings:
|
|||
m_IslandSolverBodiesPerJob: 50
|
||||
m_IslandSolverContactsPerJob: 50
|
||||
m_SimulationMode: 0
|
||||
m_SimulationLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_MaxSubStepCount: 4
|
||||
m_MinSubStepFPS: 30
|
||||
m_UseSubStepping: 0
|
||||
m_UseSubStepContacts: 0
|
||||
m_QueriesHitTriggers: 1
|
||||
m_QueriesStartInColliders: 1
|
||||
m_CallbacksOnDisable: 1
|
||||
m_ReuseCollisionCallbacks: 1
|
||||
m_AutoSyncTransforms: 0
|
||||
m_AlwaysShowColliders: 0
|
||||
m_ShowColliderSleep: 1
|
||||
m_ShowColliderContacts: 0
|
||||
m_ShowColliderAABB: 0
|
||||
m_ContactArrowScale: 0.2
|
||||
m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
|
||||
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
|
||||
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
|
||||
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
|
||||
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
m_GizmoOptions: 10
|
||||
m_LayerCollisionMatrix: fffefffffffefffffffefffffffffffffffefffffffeffff7fffffff3ffeffff48feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
m_PhysicsLowLevelSettings: {fileID: 0}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
--- !u!78 &1
|
||||
TagManager:
|
||||
serializedVersion: 3
|
||||
tags: []
|
||||
tags:
|
||||
- Ground
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
|
|
@ -11,9 +12,9 @@ TagManager:
|
|||
- Ground
|
||||
- Water
|
||||
- UI
|
||||
-
|
||||
-
|
||||
-
|
||||
- Player
|
||||
- Ghost
|
||||
- GhostHead
|
||||
-
|
||||
-
|
||||
-
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user