From 6489a9f2499ac016f042b74ed3d4a7f3dea800e9 Mon Sep 17 00:00:00 2001 From: _Redstone_c_ Date: Mon, 8 Feb 2021 18:36:16 +0800 Subject: [PATCH] Stairs --- Assets/Scenes/Stairs.unity | 427 ++++++++++++++++++++++++-- Assets/Scripts/MovingSphere.cs | 18 +- Assets/Sphere.prefab | 7 + ProjectSettings/DynamicsManager.asset | 8 +- ProjectSettings/TagManager.asset | 4 +- 5 files changed, 429 insertions(+), 35 deletions(-) diff --git a/Assets/Scenes/Stairs.unity b/Assets/Scenes/Stairs.unity index 06a13a9..35a4c62 100644 --- a/Assets/Scenes/Stairs.unity +++ b/Assets/Scenes/Stairs.unity @@ -98,7 +98,7 @@ LightmapSettings: m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 0 + m_UseShadowmask: 1 --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -771,13 +771,82 @@ Transform: m_Father: {fileID: 1108291825} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} +--- !u!1001 &10008811 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_RootOrder + value: 27 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.z + value: 4.5 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720839, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_Name + value: Sphere + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3dd5393965472a4438e901f90d336e67, type: 3} --- !u!43 &37677401 Mesh: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18532 + m_Name: pb_Mesh15370 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -940,7 +1009,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18402 + m_Name: pb_Mesh15248 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -1213,7 +1282,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18418 + m_Name: pb_Mesh15262 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -2136,7 +2205,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18710 + m_Name: pb_Mesh15552 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -2299,7 +2368,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18568 + m_Name: pb_Mesh15406 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -2462,7 +2531,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18514 + m_Name: pb_Mesh15356 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -12301,7 +12370,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18544 + m_Name: pb_Mesh15382 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -27127,6 +27196,75 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} +--- !u!1001 &892601462 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_RootOrder + value: 28 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.z + value: 1.5 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720839, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_Name + value: Sphere + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3dd5393965472a4438e901f90d336e67, type: 3} --- !u!1 &963194225 GameObject: m_ObjectHideFlags: 0 @@ -27138,6 +27276,7 @@ GameObject: - component: {fileID: 963194228} - component: {fileID: 963194227} - component: {fileID: 963194226} + - component: {fileID: 963194229} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -27180,7 +27319,7 @@ Camera: far clip plane: 1000 field of view: 60 orthographic: 1 - orthographic size: 32.84 + orthographic size: 8 m_Depth: -1 m_CullingMask: serializedVersion: 2 @@ -27203,13 +27342,44 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 963194225} - m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 100, z: 0} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 11, y: 3, z: -20} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &963194229 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 --- !u!1 &1012598478 GameObject: m_ObjectHideFlags: 0 @@ -27326,7 +27496,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18242 + m_Name: pb_Mesh15092 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -30542,7 +30712,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18376 + m_Name: pb_Mesh15222 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -41320,6 +41490,75 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1248823627 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_RootOrder + value: 29 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.z + value: -1.5 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720839, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_Name + value: Sphere + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3dd5393965472a4438e901f90d336e67, type: 3} --- !u!1 &1252876328 GameObject: m_ObjectHideFlags: 0 @@ -48555,7 +48794,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18318 + m_Name: pb_Mesh15164 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -48828,7 +49067,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18696 + m_Name: pb_Mesh15538 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -49101,7 +49340,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18466 + m_Name: pb_Mesh15310 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -49374,7 +49613,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18290 + m_Name: pb_Mesh15138 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -49537,7 +49776,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18256 + m_Name: pb_Mesh15106 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -49694,6 +49933,75 @@ Mesh: offset: 0 size: 0 path: +--- !u!1001 &1483555285 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_RootOrder + value: 25 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.z + value: -4.5 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720839, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_Name + value: Sphere + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3dd5393965472a4438e901f90d336e67, type: 3} --- !u!1 &1533393728 GameObject: m_ObjectHideFlags: 0 @@ -49866,7 +50174,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18336 + m_Name: pb_Mesh15184 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -50029,7 +50337,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18444 + m_Name: pb_Mesh15290 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -50302,7 +50610,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18680 + m_Name: pb_Mesh15522 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -50465,7 +50773,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18592 + m_Name: pb_Mesh15430 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -50953,7 +51261,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18478 + m_Name: pb_Mesh15322 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -51110,6 +51418,75 @@ Mesh: offset: 0 size: 0 path: +--- !u!1001 &1908795186 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_RootOrder + value: 26 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalPosition.z + value: 7.5 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720835, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6426552592410720839, guid: 3dd5393965472a4438e901f90d336e67, + type: 3} + propertyPath: m_Name + value: Sphere + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3dd5393965472a4438e901f90d336e67, type: 3} --- !u!1 &1952150055 GameObject: m_ObjectHideFlags: 0 @@ -53313,7 +53690,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh18388 + m_Name: pb_Mesh15234 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 diff --git a/Assets/Scripts/MovingSphere.cs b/Assets/Scripts/MovingSphere.cs index f9f982f..efa48b0 100644 --- a/Assets/Scripts/MovingSphere.cs +++ b/Assets/Scripts/MovingSphere.cs @@ -15,7 +15,7 @@ public class MovingSphere : MonoBehaviour private int maxAirJumps = 0; [SerializeField, Range(0f, 90f)] - private float maxGroundAngle = 25f; + private float maxGroundAngle = 25f, maxStairsAngle = 50f; [SerializeField, Range(0f, 100f)] float maxSnapSpeed = 100f; @@ -24,7 +24,7 @@ public class MovingSphere : MonoBehaviour float probeDistance = 1f; [SerializeField] - LayerMask probeMask = -1; + LayerMask probeMask = -1, stairsMask = -1; private Rigidbody body; @@ -36,12 +36,19 @@ public class MovingSphere : MonoBehaviour private int jumpPhase; private Vector3 velocity; private Vector3 contactNormal; - private float minGroundDotProduct; + private float minGroundDotProduct, minStairsDotProduct; private int stepsSinceLastGrounded, stepsSinceLastJump; + private float GetMinDot(int layer) + { + return (stairsMask & (1 << layer)) == 0 ? + minGroundDotProduct : minStairsDotProduct; + } + private void OnValidate() { minGroundDotProduct = Mathf.Cos(maxGroundAngle * Mathf.Deg2Rad); + minStairsDotProduct = Mathf.Cos(maxStairsAngle * Mathf.Deg2Rad); } private void Awake() @@ -114,10 +121,11 @@ public class MovingSphere : MonoBehaviour private void EvaluateCollision(Collision collision) { + float minDot = GetMinDot(collision.gameObject.layer); for (int i = 0; i < collision.contactCount; i++) { var normal = collision.GetContact(i).normal; - if (normal.y >= minGroundDotProduct) + if (normal.y >= minDot) { groundContactCount += 1; contactNormal += normal; @@ -186,7 +194,7 @@ public class MovingSphere : MonoBehaviour { return false; } - if (hit.normal.y < minGroundDotProduct) + if (hit.normal.y < GetMinDot(hit.collider.gameObject.layer)) { return false; } diff --git a/Assets/Sphere.prefab b/Assets/Sphere.prefab index e8573b5..0eb2ce0 100644 --- a/Assets/Sphere.prefab +++ b/Assets/Sphere.prefab @@ -211,8 +211,15 @@ MonoBehaviour: jumpHeight: 2 maxAirJumps: 1 maxGroundAngle: 25 + maxStairsAngle: 50 maxSnapSpeed: 100 probeDistance: 1 + probeMask: + serializedVersion: 2 + m_Bits: 1075 + stairsMask: + serializedVersion: 2 + m_Bits: 1024 --- !u!54 &6426552592410720832 Rigidbody: m_ObjectHideFlags: 0 diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset index cdc1f3e..8a4b6f3 100644 --- a/ProjectSettings/DynamicsManager.asset +++ b/ProjectSettings/DynamicsManager.asset @@ -3,7 +3,7 @@ --- !u!55 &1 PhysicsManager: m_ObjectHideFlags: 0 - serializedVersion: 11 + serializedVersion: 13 m_Gravity: {x: 0, y: -9.81, z: 0} m_DefaultMaterial: {fileID: 0} m_BounceThreshold: 2 @@ -17,11 +17,12 @@ PhysicsManager: m_ClothInterCollisionDistance: 0 m_ClothInterCollisionStiffness: 0 m_ContactsGeneration: 1 - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_LayerCollisionMatrix: fffbfffffffbfffffffbfffffffffffffffbfffffffbfffffffffffffffffffffffdfffffffaffffc8f9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_AutoSimulation: 1 m_AutoSyncTransforms: 0 m_ReuseCollisionCallbacks: 1 m_ClothInterCollisionSettingsToggle: 0 + m_ClothGravity: {x: 0, y: -9.81, z: 0} m_ContactPairsMode: 0 m_BroadphaseType: 0 m_WorldBounds: @@ -31,4 +32,5 @@ PhysicsManager: m_FrictionType: 0 m_EnableEnhancedDeterminism: 0 m_EnableUnifiedHeightmaps: 1 - m_DefaultMaxAngluarSpeed: 7 + m_SolverType: 0 + m_DefaultMaxAngularSpeed: 7 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index eabfee7..5cddc66 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -14,8 +14,8 @@ TagManager: - - - Agent - - - - + - Detailed + - Stairs - - -