From cb79307b466a9a8dcb4856bf2035037979b7f589 Mon Sep 17 00:00:00 2001 From: Starpelly Date: Thu, 23 Dec 2021 22:36:16 -0500 Subject: [PATCH] Fixed ForkLifter hand grab bug --- .../Games/ClappyTrio/Animations/Clap.anim | 1143 ++++++++++++++++- .../Games/ClappyTrio/Animations/Idle.anim | 173 ++- Assets/Scenes/Game.unity | 69 +- Assets/Scripts/EventCaller.cs | 30 +- Assets/Scripts/GameManager.cs | 26 + Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs | 27 +- .../Games/ClappyTrio/ClappyTrioPlayer.cs | 21 +- Assets/Scripts/Games/ForkLifter/ForkLifter.cs | 8 +- .../Games/ForkLifter/ForkLifterHand.cs | 14 +- .../Games/ForkLifter/ForkLifterPlayer.cs | 9 +- Assets/Scripts/Games/ForkLifter/Pea.cs | 2 +- Assets/Scripts/Games/Minigame.cs | 16 + Assets/Scripts/Games/Minigame.cs.meta | 11 + Assets/theclappytrio.json | 54 +- 14 files changed, 1545 insertions(+), 58 deletions(-) create mode 100644 Assets/Scripts/Games/Minigame.cs create mode 100644 Assets/Scripts/Games/Minigame.cs.meta diff --git a/Assets/Resources/Sprites/Games/ClappyTrio/Animations/Clap.anim b/Assets/Resources/Sprites/Games/ClappyTrio/Animations/Clap.anim index 4927fb00..24bffd29 100644 --- a/Assets/Resources/Sprites/Games/ClappyTrio/Animations/Clap.anim +++ b/Assets/Resources/Sprites/Games/ClappyTrio/Animations/Clap.anim @@ -57,6 +57,31 @@ AnimationClip: m_PostInfinity: 2 m_RotationOrder: 4 path: tail + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: -14.462} + 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.11666667 + value: {x: 0, y: 0, z: -19.925} + 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} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Hands/ClapEffect/ClapEffect_3 m_PositionCurves: - curve: serializedVersion: 2 @@ -420,6 +445,56 @@ AnimationClip: m_PostInfinity: 2 m_RotationOrder: 4 path: Hands/ClapEffect_3 (1) + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: -2.2534251, y: -0.30203432, 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.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.11666667 + value: {x: -2.24, y: -0.293, 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.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Hands/ClapEffect/ClapEffect_3 (1) + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: -3.916, y: -0.299, 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.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.11666667 + value: {x: -3.91, y: -0.249, 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.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Hands/ClapEffect/ClapEffect_3 m_ScaleCurves: - curve: serializedVersion: 2 @@ -591,6 +666,74 @@ AnimationClip: m_PostInfinity: 2 m_RotationOrder: 4 path: Hands/ClapEffect_3 (1) + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: -1.1646066, y: 1.1646066, z: 0.7352917} + 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.05 + value: {x: -1.1646066, y: 1.1646066, z: 0.7352917} + 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.11666667 + value: {x: -0.8049761, y: 0.8049761, z: 0.50823367} + 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} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Hands/ClapEffect/ClapEffect_3 (1) + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 1.1646065, y: 1.164606, z: 0.7352917} + 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.05 + value: {x: 1.1646065, y: 1.164606, z: 0.7352917} + 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.11666667 + value: {x: 0.8049761, y: 0.8049761, z: 0.7352917} + 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} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Hands/ClapEffect/ClapEffect_3 m_FloatCurves: - curve: serializedVersion: 2 @@ -779,6 +922,210 @@ AnimationClip: path: Hands/ClapEffect_3 classID: 1 script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.05 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/ClapEffect/ClapEffect_1 + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.05 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/ClapEffect/ClapEffect_2 + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.05 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.15 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/ClapEffect/ClapEffect_3 + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.05 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.15 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/ClapEffect/ClapEffect_3 (1) + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.05 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.15 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Color.a + path: Hands/ClapEffect/ClapEffect_3 + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.05 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.15 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Color.a + path: Hands/ClapEffect/ClapEffect_3 (1) + classID: 212 + script: {fileID: 0} m_PPtrCurves: - curve: - time: 0 @@ -805,13 +1152,6 @@ AnimationClip: path: test (1) classID: 212 script: {fileID: 0} - - curve: - - time: 0 - value: {fileID: 1205416701152040810, guid: bfb4e4bb08acdb14792cdd4c46253ab0, type: 3} - attribute: m_Sprite - path: head_1 - classID: 212 - script: {fileID: 0} - curve: - time: 0 value: {fileID: -2354044729926064474, guid: bfb4e4bb08acdb14792cdd4c46253ab0, type: 3} @@ -899,6 +1239,20 @@ AnimationClip: typeID: 4 customType: 0 isPPtrCurve: 0 + - serializedVersion: 2 + path: 1540708006 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 6998349 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 - serializedVersion: 2 path: 2084025437 attribute: 4 @@ -906,6 +1260,13 @@ AnimationClip: typeID: 4 customType: 4 isPPtrCurve: 0 + - serializedVersion: 2 + path: 6998349 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 - serializedVersion: 2 path: 3373695954 attribute: 3 @@ -934,6 +1295,20 @@ AnimationClip: typeID: 4 customType: 0 isPPtrCurve: 0 + - serializedVersion: 2 + path: 1540708006 + attribute: 3 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 6998349 + attribute: 3 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 - serializedVersion: 2 path: 986104082 attribute: 2086281974 @@ -984,14 +1359,49 @@ AnimationClip: customType: 0 isPPtrCurve: 0 - serializedVersion: 2 - path: 131153305 - attribute: 0 + path: 3999574113 + attribute: 2086281974 + script: {fileID: 0} + typeID: 1 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 2003696091 + attribute: 2086281974 + script: {fileID: 0} + typeID: 1 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 6998349 + attribute: 2086281974 + script: {fileID: 0} + typeID: 1 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 1540708006 + attribute: 2086281974 + script: {fileID: 0} + typeID: 1 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 6998349 + attribute: 304273561 script: {fileID: 0} typeID: 212 - customType: 23 - isPPtrCurve: 1 + customType: 0 + isPPtrCurve: 0 - serializedVersion: 2 - path: 2752407186 + path: 1540708006 + attribute: 304273561 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 131153305 attribute: 0 script: {fileID: 0} typeID: 212 @@ -1029,7 +1439,6 @@ AnimationClip: - {fileID: 21300000, guid: ade7bb027c7cf8745a8c6de2cdad0fe4, type: 3} - {fileID: 21300000, guid: b01ec1bd0238b3443a8341bdf61719a7, type: 3} - {fileID: 21300000, guid: 7bfc6e0ecd236df4db88e0a6734409b4, type: 3} - - {fileID: 1205416701152040810, guid: bfb4e4bb08acdb14792cdd4c46253ab0, type: 3} - {fileID: -2354044729926064474, guid: bfb4e4bb08acdb14792cdd4c46253ab0, type: 3} - {fileID: -2354044729926064474, guid: bfb4e4bb08acdb14792cdd4c46253ab0, type: 3} - {fileID: 7936729200490868366, guid: bfb4e4bb08acdb14792cdd4c46253ab0, type: 3} @@ -3096,6 +3505,684 @@ AnimationClip: path: Hands/ClapEffect_3 (1) classID: 4 script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.05 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/ClapEffect/ClapEffect_1 + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.05 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/ClapEffect/ClapEffect_2 + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.05 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.15 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/ClapEffect/ClapEffect_3 + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.05 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.15 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/ClapEffect/ClapEffect_3 (1) + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -2.2534251 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: -2.24 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.x + path: Hands/ClapEffect/ClapEffect_3 (1) + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -0.30203432 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: -0.293 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.y + path: Hands/ClapEffect/ClapEffect_3 (1) + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.z + path: Hands/ClapEffect/ClapEffect_3 (1) + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1.1646066 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.05 + value: -1.1646066 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: -0.8049761 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.x + path: Hands/ClapEffect/ClapEffect_3 (1) + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1.1646066 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.05 + value: 1.1646066 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: 0.8049761 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.y + path: Hands/ClapEffect/ClapEffect_3 (1) + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.7352917 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.05 + value: 0.7352917 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: 0.50823367 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.z + path: Hands/ClapEffect/ClapEffect_3 (1) + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1.1646065 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.05 + value: 1.1646065 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: 0.8049761 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.x + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1.164606 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.05 + value: 1.164606 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: 0.8049761 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.y + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.7352917 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.05 + value: 0.7352917 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: 0.7352917 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.z + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -14.462 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: -19.925 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -3.916 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: -3.91 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.x + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -0.299 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: -0.249 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.y + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.11666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.z + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.05 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.15 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Color.a + path: Hands/ClapEffect/ClapEffect_3 + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.05 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.15 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Color.a + path: Hands/ClapEffect/ClapEffect_3 (1) + classID: 212 + script: {fileID: 0} m_EulerEditorCurves: - curve: serializedVersion: 2 @@ -3127,6 +4214,36 @@ AnimationClip: path: tail classID: 4 script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Hands/ClapEffect/ClapEffect_3 + classID: 4 + script: {fileID: 0} m_HasGenericRootTransform: 0 m_HasMotionFloatCurves: 0 m_Events: [] diff --git a/Assets/Resources/Sprites/Games/ClappyTrio/Animations/Idle.anim b/Assets/Resources/Sprites/Games/ClappyTrio/Animations/Idle.anim index 9c8137c2..b1f2c10b 100644 --- a/Assets/Resources/Sprites/Games/ClappyTrio/Animations/Idle.anim +++ b/Assets/Resources/Sprites/Games/ClappyTrio/Animations/Idle.anim @@ -160,8 +160,79 @@ AnimationClip: m_PostInfinity: 2 m_RotationOrder: 4 path: wig - m_FloatCurves: [] - m_PPtrCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/handright + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/handleft + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/handstogether + classID: 1 + script: {fileID: 0} + m_PPtrCurves: + - curve: + - time: 0 + value: {fileID: 5681663196660831668, guid: bfb4e4bb08acdb14792cdd4c46253ab0, type: 3} + attribute: m_Sprite + path: Hands/handleft + classID: 212 + script: {fileID: 0} + - curve: + - time: 0 + value: {fileID: -9049834619027126771, guid: bfb4e4bb08acdb14792cdd4c46253ab0, type: 3} + attribute: m_Sprite + path: Hands/handright + classID: 212 + script: {fileID: 0} m_SampleRate: 60 m_WrapMode: 0 m_Bounds: @@ -169,6 +240,41 @@ AnimationClip: m_Extent: {x: 0, y: 0, z: 0} m_ClipBindingConstant: genericBindings: + - serializedVersion: 2 + path: 73026576 + attribute: 2086281974 + script: {fileID: 0} + typeID: 1 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 986104082 + attribute: 2086281974 + script: {fileID: 0} + typeID: 1 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 604036472 + attribute: 2086281974 + script: {fileID: 0} + typeID: 1 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 986104082 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + - serializedVersion: 2 + path: 73026576 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 - serializedVersion: 2 path: 3373695954 attribute: 1 @@ -232,13 +338,15 @@ AnimationClip: typeID: 4 customType: 0 isPPtrCurve: 0 - pptrCurveMapping: [] + pptrCurveMapping: + - {fileID: 5681663196660831668, guid: bfb4e4bb08acdb14792cdd4c46253ab0, type: 3} + - {fileID: -9049834619027126771, guid: bfb4e4bb08acdb14792cdd4c46253ab0, type: 3} m_AnimationClipSettings: serializedVersion: 2 m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseTime: 0 m_StartTime: 0 - m_StopTime: 0 + m_StopTime: 0.016666668 m_OrientationOffsetY: 0 m_Level: 0 m_CycleOffset: 0 @@ -767,6 +875,63 @@ AnimationClip: path: legs_2 classID: 4 script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/handright + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/handleft + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Hands/handstogether + classID: 1 + script: {fileID: 0} m_EulerEditorCurves: - curve: serializedVersion: 2 diff --git a/Assets/Scenes/Game.unity b/Assets/Scenes/Game.unity index dc7b7c6a..d9d7b9be 100644 --- a/Assets/Scenes/Game.unity +++ b/Assets/Scenes/Game.unity @@ -168,6 +168,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a7c8ebd2f1b0ce448acc55b6f6608e15, type: 3} m_Name: m_EditorClassIdentifier: + firstEnable: 0 LionLeft: {fileID: 1962334731} faces: - {fileID: -5723618315912617923, guid: bfb4e4bb08acdb14792cdd4c46253ab0, type: 3} @@ -695,13 +696,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 206313026} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -3.615, y: -1.491, z: 0} m_LocalScale: {x: 1.58387, y: 1.58387, z: 1.4072311} m_Children: - {fileID: 209416149} - m_Father: {fileID: 950172045} - m_RootOrder: 3 + m_Father: {fileID: 610701222} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &206313028 SpriteRenderer: @@ -1554,7 +1555,7 @@ AudioSource: m_Enabled: 1 serializedVersion: 4 OutputAudioMixerGroup: {fileID: 0} - m_audioClip: {fileID: 8300000, guid: ebc898cbaf3e679438e83c68552e527f, type: 3} + m_audioClip: {fileID: 8300000, guid: 51af38323954a8d44874780ba4577fb4, type: 3} m_PlayOnAwake: 0 m_Volume: 1 m_Pitch: 1 @@ -1680,10 +1681,10 @@ Transform: m_GameObject: {fileID: 490794386} m_LocalRotation: {x: -0, y: -0, z: 0.1258703, w: -0.9920467} m_LocalPosition: {x: -3.916, y: -0.299, z: 0} - m_LocalScale: {x: 1.1646066, y: 1.1646066, z: 0.7352917} + m_LocalScale: {x: 1.1646065, y: 1.164606, z: 0.7352917} m_Children: [] - m_Father: {fileID: 950172045} - m_RootOrder: 5 + m_Father: {fileID: 610701222} + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: -14.462} --- !u!212 &490794388 SpriteRenderer: @@ -1760,12 +1761,12 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 510428302} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -3.1557, y: -0.172, z: 0} m_LocalScale: {x: 1.8510822, y: 1.8510822, z: 1.1687083} m_Children: [] - m_Father: {fileID: 950172045} - m_RootOrder: 4 + m_Father: {fileID: 610701222} + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &510428304 SpriteRenderer: @@ -2229,6 +2230,40 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!1 &610701221 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 610701222} + m_Layer: 0 + m_Name: ClapEffect + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &610701222 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 610701221} + 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_Children: + - {fileID: 206313027} + - {fileID: 510428303} + - {fileID: 490794387} + - {fileID: 2145437457} + m_Father: {fileID: 950172045} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &628922112 GameObject: m_ObjectHideFlags: 0 @@ -2724,7 +2759,7 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 1001 + m_SortingOrder: 30000 m_Sprite: {fileID: 21300000, guid: 3a0a4652ccc94254cade74a22a70f3ea, type: 3} m_Color: {r: 0, g: 0, b: 0, a: 1} m_FlipX: 0 @@ -3357,10 +3392,7 @@ Transform: - {fileID: 741732138} - {fileID: 601068311} - {fileID: 1810132821} - - {fileID: 206313027} - - {fileID: 510428303} - - {fileID: 490794387} - - {fileID: 2145437457} + - {fileID: 610701222} m_Father: {fileID: 1962334732} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -4267,6 +4299,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b91bd072f874c8746bee1afaf6dac3b4, type: 3} m_Name: m_EditorClassIdentifier: + firstEnable: 0 ForkLifterHand: {fileID: 1144790346} handAnim: {fileID: 1144790345} flickedObject: {fileID: 1671500045} @@ -7024,7 +7057,7 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 32767 + m_SortingOrder: 26766 m_Sprite: {fileID: 7482667652216324306, guid: ef2fa2a75dc283e40b9d4fe1f20dc6fb, type: 3} m_Color: {r: 0, g: 0, b: 0, a: 1} m_FlipX: 0 @@ -7242,8 +7275,8 @@ Transform: m_LocalPosition: {x: -2.2534251, y: -0.30203432, z: 0} m_LocalScale: {x: -1.1646066, y: 1.1646066, z: 0.7352917} m_Children: [] - m_Father: {fileID: 950172045} - m_RootOrder: 6 + m_Father: {fileID: 610701222} + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 29.4} --- !u!212 &2145437458 SpriteRenderer: diff --git a/Assets/Scripts/EventCaller.cs b/Assets/Scripts/EventCaller.cs index b08f8e8d..9c54eccf 100644 --- a/Assets/Scripts/EventCaller.cs +++ b/Assets/Scripts/EventCaller.cs @@ -15,6 +15,7 @@ namespace RhythmHeavenMania public Transform GamesHolder; private float currentBeat; private float currentLength; + private string currentSwitchGame; public delegate void EventCallback(); @@ -56,7 +57,8 @@ namespace RhythmHeavenMania { new MiniGame("gameManager", new List() { - new GameAction("end", delegate { Debug.Log("end"); }) + new GameAction("end", delegate { Debug.Log("end"); }), + new GameAction("switchGame", delegate { GameManager.instance.SwitchGame(currentSwitchGame); }) }), new MiniGame("forkLifter", new List() { @@ -73,10 +75,10 @@ namespace RhythmHeavenMania // Claps new GameAction("clap", delegate { ClappyTrio.instance.Clap(currentBeat, currentLength); }, true ), - new GameAction("bop", delegate { ClappyTrio.instance.Bop(); }, true ), + new GameAction("bop", delegate { ClappyTrio.instance.Bop(); } ), - new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(0); }, true ), - new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); }, true ), + new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(0); } ), + new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); } ), }) }; @@ -117,6 +119,8 @@ namespace RhythmHeavenMania { currentLength = GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].length; + if (details.Length > 2) currentSwitchGame = details[2]; + GameAction action = game.actions.Find(c => c.actionName == details[1]); action.function.Invoke(); @@ -130,7 +134,7 @@ namespace RhythmHeavenMania } } - public static List GetAllInGameManagerListExcept(string gameName, string[] exclude) + public static List GetAllInGameManagerList(string gameName, string[] exclude) { List temp1 = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel.Split('/')[0] == gameName); List temp2 = new List(); @@ -143,5 +147,21 @@ namespace RhythmHeavenMania } return temp2; } + + public static List GetAllPlayerEntities(string gameName) + { + return GameManager.instance.playerEntities.FindAll(c => c.datamodel.Split('/')[0] == gameName); + } + + public static List GetAllPlayerEntitiesExcept(string gameName) + { + return GameManager.instance.playerEntities.FindAll(c => c.datamodel.Split('/')[0] != gameName); + } + + // elaborate as fuck, boy + public static List GetAllPlayerEntitiesExceptBeforeBeat(string gameName, float beat) + { + return GameManager.instance.playerEntities.FindAll(c => c.datamodel.Split('/')[0] != gameName && c.beat < beat); + } } } \ No newline at end of file diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 3284e474..515fc83d 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -6,6 +6,7 @@ using UnityEngine; using Starpelly; using Newtonsoft.Json; +using RhythmHeavenMania.Games; namespace RhythmHeavenMania { @@ -23,6 +24,9 @@ namespace RhythmHeavenMania public float startOffset; + [Header("Games")] + Coroutine currentGameSwitchIE; + private string currentGame; private void Awake() { @@ -45,6 +49,8 @@ namespace RhythmHeavenMania Conductor.instance.SetBpm(Beatmap.bpm); StartCoroutine(Begin()); + + currentGame = eventCaller.GamesHolder.GetComponentsInChildren()[1].name; } private IEnumerator Begin() @@ -97,6 +103,26 @@ namespace RhythmHeavenMania } } + public void SwitchGame(string game) + { + if (currentGameSwitchIE != null) StopCoroutine(currentGameSwitchIE); + currentGameSwitchIE = StartCoroutine(SwitchGameIE(game)); + } + + IEnumerator SwitchGameIE(string game) + { + this.GetComponent().enabled = true; + + eventCaller.minigames.Find(c => c.name == currentGame).holder.SetActive(false); + eventCaller.minigames.Find(c => c.name == game).holder.SetActive(true); + eventCaller.minigames.Find(c => c.name == game).holder.GetComponent().OnGameSwitch(); + currentGame = game; + + yield return new WaitForSeconds(0.1666f); + + + this.GetComponent().enabled = false; + } private void OnGUI() { diff --git a/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs b/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs index 919259ad..f1bca9ab 100644 --- a/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs +++ b/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs @@ -6,7 +6,7 @@ using RhythmHeavenMania.Util; namespace RhythmHeavenMania.Games.ClappyTrio { - public class ClappyTrio : MonoBehaviour + public class ClappyTrio : Minigame { [SerializeField] private GameObject LionLeft; private GameObject LionMiddle; @@ -24,7 +24,6 @@ namespace RhythmHeavenMania.Games.ClappyTrio public bool playerHitLast = false; - public static ClappyTrio instance { get; set; } private void Awake() @@ -32,6 +31,14 @@ namespace RhythmHeavenMania.Games.ClappyTrio instance = this; } + public override void OnGameSwitch() + { + SetFace(0, 0); + SetFace(1, 0); + SetFace(2, 0); + PlayAnimationAll("Idle"); + } + private void Start() { LionMiddle = Instantiate(LionLeft, LionLeft.transform.parent); @@ -76,12 +83,16 @@ namespace RhythmHeavenMania.Games.ClappyTrio clapIndex = 0; isClapping = false; currentClappingLength = 0; + ClappyTrioPlayer.clapStarted = false; } } } public void Clap(float beat, float length) { + ClappyTrioPlayer.clapStarted = true; + ClappyTrioPlayer.canHit = true; // this is technically a lie, this just restores the ability to hit + playerHitLast = false; isClapping = true; lastClapStart = beat; @@ -105,14 +116,20 @@ namespace RhythmHeavenMania.Games.ClappyTrio SetFace(1, 1); SetFace(2, 1); } + else + { + SetFace(0, 2); + SetFace(1, 2); + SetFace(2, 0); + } PlayAnimationAll("Bop"); } private void PlayAnimationAll(string anim) { - LionLeft.GetComponent().Play(anim, 0, 0); - LionMiddle.GetComponent().Play(anim, 0, 0); - LionPlayer.GetComponent().Play(anim, 0, 0); + LionLeft.GetComponent().Play(anim, -1, 0); + LionMiddle.GetComponent().Play(anim, -1, 0); + LionPlayer.GetComponent().Play(anim, -1, 0); } public void SetFace(int lion, int type) diff --git a/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs b/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs index 55cd8daa..cae7c1bb 100644 --- a/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs +++ b/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs @@ -17,10 +17,20 @@ namespace RhythmHeavenMania.Games.ClappyTrio private int lastIndex; - private float perfectTime = 0.25f, lateTime = 0.46f; + private float perfectTime = 0.25f, lateTime = 0.43f; private bool hit; + public bool clapStarted = false; + public bool canHit; + + private GameObject clapEffect; + + private void Start() + { + clapEffect = transform.GetChild(4).GetChild(3).gameObject; + } + private void Update() { if (PlayerInput.Pressed()) @@ -79,13 +89,20 @@ namespace RhythmHeavenMania.Games.ClappyTrio if (canHit) { + clapEffect.SetActive(true); Jukebox.PlayOneShotGame("clappyTrio/rightClap"); - ClappyTrio.instance.playerHitLast = true; + + if (this.canHit) + ClappyTrio.instance.playerHitLast = true; } else { + clapEffect.SetActive(false); Jukebox.PlayOneShot("miss"); ClappyTrio.instance.playerHitLast = false; + + if (clapStarted) + this.canHit = false; } ClappyTrio.instance.SetFace(2, 4); diff --git a/Assets/Scripts/Games/ForkLifter/ForkLifter.cs b/Assets/Scripts/Games/ForkLifter/ForkLifter.cs index 83f9f3ca..654705cf 100644 --- a/Assets/Scripts/Games/ForkLifter/ForkLifter.cs +++ b/Assets/Scripts/Games/ForkLifter/ForkLifter.cs @@ -8,7 +8,7 @@ using DG.Tweening; namespace RhythmHeavenMania.Games.ForkLifter { - public class ForkLifter : MonoBehaviour + public class ForkLifter : Minigame { public static ForkLifter instance; @@ -33,6 +33,12 @@ namespace RhythmHeavenMania.Games.ForkLifter instance = this; } + public override void OnGameSwitch() + { + ForkLifterHand.CheckNextFlick(); + ForkLifterPlayer.instance.RemoveObjFromFork(); + } + private void Start() { GameManager = GameManager.instance; diff --git a/Assets/Scripts/Games/ForkLifter/ForkLifterHand.cs b/Assets/Scripts/Games/ForkLifter/ForkLifterHand.cs index 2be2d796..fa8e58c8 100644 --- a/Assets/Scripts/Games/ForkLifter/ForkLifterHand.cs +++ b/Assets/Scripts/Games/ForkLifter/ForkLifterHand.cs @@ -17,27 +17,29 @@ namespace RhythmHeavenMania.Games.ForkLifter public void CheckNextFlick() { - allPlayerActions = EventCaller.GetAllInGameManagerListExcept("forkLifter", new string[] { "gulp", "sigh", "prepare" }); + // allPlayerActions = EventCaller.GetAllInGameManagerList("forkLifter", new string[] { "gulp", "sigh", "prepare" }); + allPlayerActions = EventCaller.GetAllPlayerEntities("forkLifter"); + int currentPlayerEvent = GameManager.instance.currentPlayerEvent - EventCaller.GetAllPlayerEntitiesExceptBeforeBeat("forkLifter", Conductor.instance.songPositionInBeats).Count; - if (GameManager.instance.currentPlayerEvent < allPlayerActions.Count) + if (currentPlayerEvent < allPlayerActions.Count) { - switch (allPlayerActions[GameManager.instance.currentPlayerEvent].datamodel.Split('/')[1]) + switch (allPlayerActions[currentPlayerEvent].datamodel.Split('/')[1]) { case "pea": ForkLifter.instance.peaPreview.sprite = ForkLifter.instance.peaSprites[0]; fastSprite.sprite = fastSprites[0]; break; case "topbun": - fastSprite.sprite = fastSprites[0]; ForkLifter.instance.peaPreview.sprite = ForkLifter.instance.peaSprites[1]; + fastSprite.sprite = fastSprites[0]; break; case "burger": - fastSprite.sprite = fastSprites[1]; ForkLifter.instance.peaPreview.sprite = ForkLifter.instance.peaSprites[2]; + fastSprite.sprite = fastSprites[1]; break; case "bottombun": - fastSprite.sprite = fastSprites[0]; ForkLifter.instance.peaPreview.sprite = ForkLifter.instance.peaSprites[3]; + fastSprite.sprite = fastSprites[0]; break; } } diff --git a/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs b/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs index 40fed5ae..23af853e 100644 --- a/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs +++ b/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs @@ -105,6 +105,11 @@ namespace RhythmHeavenMania.Games.ForkLifter } } + RemoveObjFromFork(); + } + + public void RemoveObjFromFork() + { for (int i = 0; i < early.transform.childCount; i++) { Destroy(early.transform.GetChild(i).gameObject); @@ -220,7 +225,7 @@ namespace RhythmHeavenMania.Games.ForkLifter FastEffectHit(EligibleHits[currentHitInList].pea.type); - Jukebox.PlayOneShotGame("miss"); + Jukebox.PlayOneShot("miss"); currentEarlyPeasOnFork++; @@ -249,7 +254,7 @@ namespace RhythmHeavenMania.Games.ForkLifter FastEffectHit(EligibleHits[currentHitInList].pea.type); - Jukebox.PlayOneShotGame("miss"); + Jukebox.PlayOneShot("miss"); currentLatePeasOnFork++; diff --git a/Assets/Scripts/Games/ForkLifter/Pea.cs b/Assets/Scripts/Games/ForkLifter/Pea.cs index c5c23e8f..9a83ddc8 100644 --- a/Assets/Scripts/Games/ForkLifter/Pea.cs +++ b/Assets/Scripts/Games/ForkLifter/Pea.cs @@ -73,7 +73,7 @@ namespace RhythmHeavenMania.Games.ForkLifter if (normalizedBeat > endTime && endstate <= 1) { endstate++; - Jukebox.PlayOneShotGame("audience/disappointed"); + Jukebox.PlayOneShot("audience/disappointed"); } if (normalizedBeat > 1.35f) diff --git a/Assets/Scripts/Games/Minigame.cs b/Assets/Scripts/Games/Minigame.cs new file mode 100644 index 00000000..1f839502 --- /dev/null +++ b/Assets/Scripts/Games/Minigame.cs @@ -0,0 +1,16 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace RhythmHeavenMania.Games +{ + public class Minigame : MonoBehaviour + { + public int firstEnable = 0; + + public virtual void OnGameSwitch() + { + + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Games/Minigame.cs.meta b/Assets/Scripts/Games/Minigame.cs.meta new file mode 100644 index 00000000..b7872136 --- /dev/null +++ b/Assets/Scripts/Games/Minigame.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c59cddacfd5c42547b00e692560a8312 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/theclappytrio.json b/Assets/theclappytrio.json index f52c7fdc..a6e653c4 100644 --- a/Assets/theclappytrio.json +++ b/Assets/theclappytrio.json @@ -1,5 +1,5 @@ { - "bpm": 117.26, + "bpm": 130, "entities": [ { "beat": 1, @@ -67,6 +67,58 @@ { "beat": 19, "datamodel": "clappyTrio/bop" + }, + + + { + "beat": 28, + "datamodel": "gameManager/switchGame/forkLifter" + }, + { + "beat": 29, + "datamodel": "forkLifter/pea" + }, + { + "beat": 32, + "datamodel": "gameManager/switchGame/clappyTrio" + }, + { + "beat": 33, + "length": 1, + "datamodel": "clappyTrio/clap" + }, + { + "beat": 36, + "datamodel": "gameManager/switchGame/forkLifter" + }, + { + "beat": 37, + "datamodel": "forkLifter/pea" + }, + { + "beat": 40, + "datamodel": "gameManager/switchGame/clappyTrio" + }, + { + "beat": 41, + "length": 1, + "datamodel": "clappyTrio/clap" + }, + { + "beat": 44, + "datamodel": "clappyTrio/bop" + }, + { + "beat": 44.25, + "datamodel": "gameManager/switchGame/forkLifter" + }, + { + "beat": 45, + "datamodel": "forkLifter/topbun" + }, + { + "beat": 45.5, + "datamodel": "forkLifter/pea" } ] } \ No newline at end of file