Skip to content
Snippets Groups Projects
Commit 54dd117f authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

Modification de la détection des plateformes & animation de la balle

parent 09308f8d
No related branches found
No related tags found
No related merge requests found
......@@ -21,38 +21,65 @@ AnimationClip:
- serializedVersion: 3
time: 0
value: {x: 0, y: 0.5, z: 0}
inSlope: {x: 0, y: 7.4726887, z: 0}
outSlope: {x: 0, y: 7.4726887, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.13268612, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.20305097, z: 0.33333334}
- serializedVersion: 3
time: 0.31666666
value: {x: 0, y: 2, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
time: 0.16666667
value: {x: 0, y: 2.3167236, z: 0}
inSlope: {x: 0, y: 5.629777, z: 0}
outSlope: {x: 0, y: 5.629777, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.23333333
value: {x: 0, y: 2.494247, z: 0}
inSlope: {x: 0, y: 0.586155, z: 0}
outSlope: {x: 0, y: 0.586155, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.25
value: {x: 0, y: 2.5, z: 0}
inSlope: {x: 0, y: 0.15983802, z: 0}
outSlope: {x: 0, y: 0.15983802, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.18675756, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.26666668
value: {x: 0, y: 2.5009909, z: 0}
inSlope: {x: 0, y: -0.10952116, z: 0}
outSlope: {x: 0, y: -0.10952116, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.35
value: {x: 0, y: 2, z: 0}
inSlope: {x: 0, y: -0, z: 0}
outSlope: {x: 0, y: -0.68320674, z: 0}
value: {x: 0, y: 2.25, z: 0}
inSlope: {x: 0, y: -7.628853, z: 0}
outSlope: {x: 0, y: -7.628853, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.058349077, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.6666667
time: 0.5
value: {x: 0, y: 0.5, z: 0}
inSlope: {x: 0, y: -6.814097, z: 0}
outSlope: {x: 0, y: -6.814097, z: 0}
inSlope: {x: 0, y: -0, z: 0}
outSlope: {x: 0, y: -0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.07590347, z: 0.33333334}
inWeight: {x: 0.33333334, y: 0.13255453, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
......@@ -72,16 +99,7 @@ AnimationClip:
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.3
value: {x: 0.5, y: 1, z: 0.5}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.35
time: 0.25
value: {x: 0.5, y: 1, z: 0.5}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
......@@ -90,7 +108,7 @@ AnimationClip:
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.6666667
time: 0.5
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
......@@ -131,7 +149,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.6666667
m_StopTime: 0.5
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
......@@ -160,7 +178,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.31666666
time: 0.23333333
value: 0
inSlope: 0
outSlope: 0
......@@ -169,7 +187,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.35
time: 0.26666668
value: 0
inSlope: 0
outSlope: 0
......@@ -178,7 +196,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
time: 0.5
value: 0
inSlope: 0
outSlope: 0
......@@ -199,38 +217,47 @@ AnimationClip:
- serializedVersion: 3
time: 0
value: 0.5
inSlope: 7.4726887
outSlope: 7.4726887
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.13268612
outWeight: 0.20305097
- serializedVersion: 3
time: 0.31666666
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
time: 0.16666667
value: 2.3167236
inSlope: 5.629777
outSlope: 5.629777
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.25
value: 2.5
inSlope: 0.15983802
outSlope: 0.15983802
tangentMode: 0
weightedMode: 0
inWeight: 0.18675756
outWeight: 0.33333334
- serializedVersion: 3
time: 0.35
value: 2
inSlope: -0
outSlope: -0.68320674
tangentMode: 5
value: 2.25
inSlope: -7.628853
outSlope: -7.628853
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.058349077
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
time: 0.5
value: 0.5
inSlope: -6.814097
outSlope: -6.814097
inSlope: -0
outSlope: -0
tangentMode: 0
weightedMode: 0
inWeight: 0.07590347
inWeight: 0.13255453
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
......@@ -252,7 +279,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.31666666
time: 0.23333333
value: 0
inSlope: 0
outSlope: 0
......@@ -261,7 +288,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.35
time: 0.26666668
value: 0
inSlope: 0
outSlope: 0
......@@ -270,7 +297,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
time: 0.5
value: 0
inSlope: 0
outSlope: 0
......@@ -298,16 +325,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.3
value: 0.5
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.35
time: 0.25
value: 0.5
inSlope: 0
outSlope: 0
......@@ -316,7 +334,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
time: 0.5
value: 1
inSlope: 0
outSlope: 0
......@@ -344,7 +362,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.3
time: 0.25
value: 1
inSlope: 0
outSlope: 0
......@@ -353,16 +371,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.35
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
time: 0.5
value: 1
inSlope: 0
outSlope: 0
......@@ -390,16 +399,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.3
value: 0.5
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.35
time: 0.25
value: 0.5
inSlope: 0
outSlope: 0
......@@ -408,7 +408,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
time: 0.5
value: 1
inSlope: 0
outSlope: 0
......
......@@ -11,8 +11,8 @@ GameObject:
- component: {fileID: 8734763122887161288}
- component: {fileID: 8734763122887161293}
- component: {fileID: 8734763122887161290}
- component: {fileID: 8734763122887161291}
- component: {fileID: 9115919524839369716}
- component: {fileID: 5530935209088123477}
m_Layer: 0
m_Name: Platfom
m_TagString: Platform
......@@ -83,20 +83,6 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!136 &8734763122887161291
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8734763122887161289}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 0.5000001
m_Height: 2
m_Direction: 1
m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697}
--- !u!114 &9115919524839369716
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -110,3 +96,17 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
activeMaterial: {fileID: 2100000, guid: 6b64c2ad69c8cf842b18c8d30c93fc92, type: 2}
--- !u!64 &5530935209088123477
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8734763122887161289}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 4
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
This diff is collapsed.
......@@ -69,16 +69,20 @@ public class BallBehavior : MonoBehaviour
Debug.Log("Game Over: " + _ball.transform.position.y + " " + isGrounded);
_gameOver = true;
}
}
private void FixedUpdate()
{
if (!_hasTriggeredPlatform && isGrounded)
{
// We have to get the gameobject just below with a raycast
if (Physics.Raycast(_ballBottomPos, Vector3.down, out var hit, 1f))
Collider[] hitColliders = Physics.OverlapSphere(_ballBottomPos, groundCheckDistance, groundMask);
foreach (var hitCollider in hitColliders)
{
if (hit.collider.gameObject.CompareTag("Platform"))
if (hitCollider.gameObject.CompareTag("Platform"))
{
Debug.Log("Platform triggered");
hit.collider.gameObject.GetComponent<PlatformsBehavior>().setActive();
hitCollider.gameObject.GetComponent<PlatformsBehavior>().setActive();
Debug.Log("Platform Triggered");
_hasTriggeredPlatform = true;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment