From 4505018ec773c5de47627d234290dbc6aecc129f Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Wed, 22 Nov 2023 02:07:35 +0100 Subject: [PATCH] Blue Bear Final Tweaks (#581) * scaled animations + barely + new curves * emotion system revamped * Whiff sound!!! --- Assets/Resources/Games/blueBear.prefab | 485 ++---------------- .../Sfx/games/blueBear/whiff.wav.meta | 22 + Assets/Scripts/Games/BlueBear/BlueBear.cs | 207 +++++--- Assets/Scripts/Games/BlueBear/Treat.cs | 63 ++- Assets/Scripts/Util/AnimationHelpers.cs | 5 + 5 files changed, 244 insertions(+), 538 deletions(-) create mode 100644 Assets/Resources/Sfx/games/blueBear/whiff.wav.meta diff --git a/Assets/Resources/Games/blueBear.prefab b/Assets/Resources/Games/blueBear.prefab index 20ae1137..c5171492 100644 --- a/Assets/Resources/Games/blueBear.prefab +++ b/Assets/Resources/Games/blueBear.prefab @@ -33,62 +33,6 @@ Transform: m_Father: {fileID: 6960831429059082753} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &290228492427971646 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6329961769281807094} - - component: {fileID: 4010886351829930261} - m_Layer: 0 - m_Name: DonutCurve - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &6329961769281807094 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 290228492427971646} - 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: - - {fileID: 5421637543485503317} - - {fileID: 3691807933677802949} - - {fileID: 3150862288141982050} - m_Father: {fileID: 8746993661413993986} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &4010886351829930261 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 290228492427971646} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 066a41e004f415b4eb74d5e61a2aadbe, type: 3} - m_Name: - m_EditorClassIdentifier: - curveColor: {r: 0, g: 1, b: 0, a: 1} - startPointColor: {r: 1, g: 0, b: 0, a: 1} - endPointColor: {r: 0, g: 0, b: 1, a: 1} - sampling: 25 - keyPoints: - - {fileID: 3229741095474240392} - - {fileID: 5844169753873806744} - - {fileID: 8573860549249418625} - normalizedTime: 0.6 --- !u!1 &471349468795412199 GameObject: m_ObjectHideFlags: 0 @@ -5650,39 +5594,6 @@ Transform: m_Father: {fileID: 5813499711186931250} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2117851015664542161 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8746993661413993986} - m_Layer: 0 - m_Name: Curves - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &8746993661413993986 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2117851015664542161} - 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: - - {fileID: 6329961769281807094} - - {fileID: 3593119893011264580} - m_Father: {fileID: 5813499711186931250} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2128961569128384440 GameObject: m_ObjectHideFlags: 0 @@ -5715,7 +5626,7 @@ Transform: - {fileID: 7577381734816330351} - {fileID: 3145709441744219950} m_Father: {fileID: 5813499711186931250} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!95 &435615509351659063 Animator: @@ -5738,54 +5649,6 @@ Animator: m_AllowConstantClipSamplingOptimization: 1 m_KeepAnimatorStateOnDisable: 0 m_WriteDefaultValuesOnDisable: 0 ---- !u!1 &2367708131139839123 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6040988351714367052} - - component: {fileID: 4773903569383290023} - m_Layer: 0 - m_Name: Point 2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &6040988351714367052 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2367708131139839123} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -5, y: -12.3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 3593119893011264580} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &4773903569383290023 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2367708131139839123} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3} - m_Name: - m_EditorClassIdentifier: - curve: {fileID: 5500614478733336177} - handleType: 0 - leftHandleLocalPosition: {x: 0.19151115, y: 6.0157824, z: 0} - rightHandleLocalPosition: {x: -0.19151115, y: -6.0157824, z: -0} --- !u!1 &2385043071357490508 GameObject: m_ObjectHideFlags: 0 @@ -6016,7 +5879,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 5813499711186931250} - m_RootOrder: 8 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &8901463518339414129 SpriteRenderer: @@ -6154,54 +6017,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!1 &2972698800083633547 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3691807933677802949} - - component: {fileID: 5844169753873806744} - m_Layer: 0 - m_Name: Point 1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &3691807933677802949 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2972698800083633547} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 3.2, y: 3.9999998, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 6329961769281807094} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &5844169753873806744 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2972698800083633547} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3} - m_Name: - m_EditorClassIdentifier: - curve: {fileID: 4010886351829930261} - handleType: 0 - leftHandleLocalPosition: {x: -0.5, y: -0, z: -0} - rightHandleLocalPosition: {x: 0.5, y: 0, z: 0} --- !u!1 &3272805707290525802 GameObject: m_ObjectHideFlags: 0 @@ -6237,7 +6052,7 @@ Transform: - {fileID: 3912340903949694468} - {fileID: 2724047915994653680} m_Father: {fileID: 5813499711186931250} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!95 &1672690672723614704 Animator: @@ -6260,54 +6075,6 @@ Animator: m_AllowConstantClipSamplingOptimization: 1 m_KeepAnimatorStateOnDisable: 0 m_WriteDefaultValuesOnDisable: 0 ---- !u!1 &3386726751787149544 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1189969421379328708} - - component: {fileID: 7051398189816610608} - m_Layer: 0 - m_Name: Point 1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1189969421379328708 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3386726751787149544} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -3.3230858, y: 14.9, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 3593119893011264580} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &7051398189816610608 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3386726751787149544} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3} - m_Name: - m_EditorClassIdentifier: - curve: {fileID: 5500614478733336177} - handleType: 0 - leftHandleLocalPosition: {x: 0.5, y: 0, z: 0} - rightHandleLocalPosition: {x: -0.5, y: -0, z: -0} --- !u!1 &3577761986294505711 GameObject: m_ObjectHideFlags: 0 @@ -6522,6 +6289,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f7dae340f4a85ba44ab2f8cfd4429430, type: 3} m_Name: m_EditorClassIdentifier: + offset: {x: 0, y: 0, z: 0} isCake: 0 startBeat: 0 --- !u!1 &4021263521913631461 @@ -6781,62 +6549,6 @@ Animator: m_AllowConstantClipSamplingOptimization: 1 m_KeepAnimatorStateOnDisable: 0 m_WriteDefaultValuesOnDisable: 0 ---- !u!1 &4732423349660717250 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3593119893011264580} - - component: {fileID: 5500614478733336177} - m_Layer: 0 - m_Name: CakeCurve - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &3593119893011264580 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4732423349660717250} - 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: - - {fileID: 5019461457677901195} - - {fileID: 1189969421379328708} - - {fileID: 6040988351714367052} - m_Father: {fileID: 8746993661413993986} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &5500614478733336177 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4732423349660717250} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 066a41e004f415b4eb74d5e61a2aadbe, type: 3} - m_Name: - m_EditorClassIdentifier: - curveColor: {r: 0, g: 1, b: 0, a: 1} - startPointColor: {r: 1, g: 0, b: 0, a: 1} - endPointColor: {r: 0, g: 0, b: 1, a: 1} - sampling: 25 - keyPoints: - - {fileID: 5655647647436070703} - - {fileID: 7051398189816610608} - - {fileID: 4773903569383290023} - normalizedTime: 0.75 --- !u!1 &4851098416927797487 GameObject: m_ObjectHideFlags: 0 @@ -7148,54 +6860,6 @@ Animator: m_AllowConstantClipSamplingOptimization: 1 m_KeepAnimatorStateOnDisable: 0 m_WriteDefaultValuesOnDisable: 0 ---- !u!1 &5251011089174362824 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 5019461457677901195} - - component: {fileID: 5655647647436070703} - m_Layer: 0 - m_Name: Point 0 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &5019461457677901195 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5251011089174362824} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -1.5, y: -4, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 3593119893011264580} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &5655647647436070703 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5251011089174362824} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3} - m_Name: - m_EditorClassIdentifier: - curve: {fileID: 5500614478733336177} - handleType: 0 - leftHandleLocalPosition: {x: 1.1635425, y: -13.234132, z: -0} - rightHandleLocalPosition: {x: -1.1635425, y: 13.234132, z: 0} --- !u!1 &5422684780013435000 GameObject: m_ObjectHideFlags: 0 @@ -7535,7 +7199,6 @@ Transform: - {fileID: 716902796083954310} - {fileID: 5011532919799571745} - {fileID: 4768386529512104537} - - {fileID: 8746993661413993986} - {fileID: 5813499711658895220} - {fileID: 1786192994432166401} - {fileID: 5860131706849385657} @@ -7572,8 +7235,43 @@ MonoBehaviour: foodHolder: {fileID: 5011532919799571745} crumbsHolder: {fileID: 4768386529512104537} individualBagHolder: {fileID: 199889193875870520} - donutCurve: {fileID: 4010886351829930261} - cakeCurve: {fileID: 5500614478733336177} + _treatCurves: + - name: Donut + preview: 1 + anchor: {fileID: 0} + positions: + - tag: + pos: {x: 1.496, y: -4.014, z: 0} + target: {fileID: 0} + height: 5 + duration: 2 + useLastRealPos: 0 + values: [] + - tag: + pos: {x: 4.9, y: 0.62, z: 0} + target: {fileID: 0} + height: 0 + duration: 0 + useLastRealPos: 0 + values: [] + - name: Cake + preview: 1 + anchor: {fileID: 0} + positions: + - tag: + pos: {x: -1.498, y: -4.01, z: 0} + target: {fileID: 0} + height: 18 + duration: 3 + useLastRealPos: 0 + values: [] + - tag: + pos: {x: -4.63, y: 0.63, z: 0} + target: {fileID: 0} + height: 0 + duration: 0 + useLastRealPos: 0 + values: [] donutGradient: serializedVersion: 2 key0: {r: 0.92941177, g: 0.69411767, b: 0.23921569, a: 1} @@ -7667,7 +7365,7 @@ Transform: - {fileID: 1065936263090570038} - {fileID: 3325397362945256426} m_Father: {fileID: 5813499711186931250} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!95 &6092762685894244170 Animator: @@ -7787,6 +7485,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f7dae340f4a85ba44ab2f8cfd4429430, type: 3} m_Name: m_EditorClassIdentifier: + offset: {x: 0, y: 0, z: 0} isCake: 1 startBeat: 0 --- !u!1 &5988159118627703275 @@ -8467,7 +8166,7 @@ Transform: - {fileID: 8086662841372816991} - {fileID: 5542312890775929452} m_Father: {fileID: 5813499711186931250} - m_RootOrder: 9 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!95 &920502940108507811 Animator: @@ -8764,54 +8463,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!1 &8021092099866450225 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3150862288141982050} - - component: {fileID: 8573860549249418625} - m_Layer: 0 - m_Name: Point 2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &3150862288141982050 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8021092099866450225} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 5.5, y: -12.1, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 6329961769281807094} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &8573860549249418625 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8021092099866450225} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3} - m_Name: - m_EditorClassIdentifier: - curve: {fileID: 4010886351829930261} - handleType: 0 - leftHandleLocalPosition: {x: -0.45544052, y: 8.296009, z: 0} - rightHandleLocalPosition: {x: 0.45544052, y: -8.296009, z: -0} --- !u!1 &8074909055883004200 GameObject: m_ObjectHideFlags: 0 @@ -9264,54 +8915,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!1 &8671544535564718561 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 5421637543485503317} - - component: {fileID: 3229741095474240392} - m_Layer: 0 - m_Name: Point 0 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &5421637543485503317 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8671544535564718561} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1.5, y: -4, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 6329961769281807094} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &3229741095474240392 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8671544535564718561} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3} - m_Name: - m_EditorClassIdentifier: - curve: {fileID: 4010886351829930261} - handleType: 0 - leftHandleLocalPosition: {x: -0.29808784, y: -4.615514, z: -0} - rightHandleLocalPosition: {x: 0.29808784, y: 4.615514, z: 0} --- !u!1 &9061361398430418040 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Resources/Sfx/games/blueBear/whiff.wav.meta b/Assets/Resources/Sfx/games/blueBear/whiff.wav.meta new file mode 100644 index 00000000..1ccc7067 --- /dev/null +++ b/Assets/Resources/Sfx/games/blueBear/whiff.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 2448776798073114dbaa07b1c4a83cd8 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Games/BlueBear/BlueBear.cs b/Assets/Scripts/Games/BlueBear/BlueBear.cs index 2420c6e4..db579539 100644 --- a/Assets/Scripts/Games/BlueBear/BlueBear.cs +++ b/Assets/Scripts/Games/BlueBear/BlueBear.cs @@ -27,13 +27,21 @@ namespace HeavenStudio.Games.Loaders function = delegate { BlueBear.instance.SpawnTreat(eventCaller.currentEntity.beat, true, eventCaller.currentEntity.beat); }, defaultLength = 4, }, - new GameAction("setEmotion", "Set Emotion") + new GameAction("setEmotion", "Emotion") { - function = delegate { var e = eventCaller.currentEntity; BlueBear.instance.SetEmotion(e.beat, e.length, e["type"]); }, - defaultLength = 0.5f, + function = delegate { var e = eventCaller.currentEntity; BlueBear.instance.SetEmotion(e["type"]); }, parameters = new List() { - new Param("type", BlueBear.EmotionType.ClosedEyes, "Type", "Which emotion should the blue bear use?") + new Param("type", BlueBear.EmotionType.ClosedEyes, "Emotion", "Which emotion should the blue bear use?") + } + }, + new GameAction("stretchEmotion", "Long Emotion") + { + defaultLength = 4, + resizable = true, + parameters = new List() + { + new Param("type", BlueBear.EmotionStretchType.LookUp, "Emotion", "Which emotion should the blue bear use?") } }, new GameAction("wind", "Wind") @@ -75,17 +83,21 @@ namespace HeavenStudio.Games { using Jukebox; using Scripts_BlueBear; + public class BlueBear : Minigame { public enum EmotionType { - Neutral, - ClosedEyes, - LookUp, - Smile, - Sad, - InstaSad, - Sigh + Neutral = 0, + ClosedEyes = 1, + Cry = 2, + Sigh = 3 + } + public enum EmotionStretchType + { + LookUp = 0, + Smile = 1, + StartCrying = 2, } public enum StoryType { @@ -117,15 +129,9 @@ namespace HeavenStudio.Games static int rightCrumbAppearThreshold = 15; static int leftCrumbAppearThreshold = 30; static int eatenTreats = 0; - double emotionStartBeat; - float emotionLength; - string emotionAnimName; bool crying; private List _allStoryEvents = new(); - - [Header("Curves")] - public BezierCurve3D donutCurve; - public BezierCurve3D cakeCurve; + [SerializeField] private SuperCurveObject.Path[] _treatCurves; [Header("Gradients")] public Gradient donutGradient; @@ -190,6 +196,31 @@ namespace HeavenStudio.Games new("CtrBearRight", new int[] { IARight, IARight, IARight }, IA_PadRight, IA_TouchRight, IA_BatonRight); + // Editor gizmo to draw trajectories + new void OnDrawGizmos() + { + base.OnDrawGizmos(); + foreach (SuperCurveObject.Path path in _treatCurves) + { + if (path.preview) + { + donutBase.GetComponent().DrawEditorGizmo(path); + } + } + } + + public SuperCurveObject.Path GetPath(string name) + { + foreach (SuperCurveObject.Path path in _treatCurves) + { + if (path.name == name) + { + return path; + } + } + return default(SuperCurveObject.Path); + } + void OnDestroy() { foreach (var evt in scheduledInputs) @@ -254,37 +285,100 @@ namespace HeavenStudio.Games private void Update() { headAndBodyAnim.SetBool("ShouldOpenMouth", foodHolder.childCount != 0); + if (headAndBodyAnim.GetBool("ShouldOpenMouth")) + { + _emotionCancelled = true; + } if (PlayerInput.GetIsAction(InputAction_Left) && !IsExpectingInputNow(InputAction_Left.inputLockCategory)) { + SoundByte.PlayOneShotGame("blueBear/whiff"); Bite(true); } else if (PlayerInput.GetIsAction(InputAction_Right) && !IsExpectingInputNow(InputAction_Right.inputLockCategory)) { + SoundByte.PlayOneShotGame("blueBear/whiff"); Bite(false); } - Conductor cond = Conductor.instance; + UpdateEmotions(); - if (cond.isPlaying && !cond.isPaused) - { - float normalizedBeat = cond.GetPositionFromBeat(emotionStartBeat, emotionLength); - if (normalizedBeat >= 0 && normalizedBeat <= 1f) - { - //headAndBodyAnim.DoNormalizedAnimation(emotionAnimName, normalizedBeat); - } - } UpdateStory(); + headAndBodyAnim.SetScaledAnimationSpeed(); + bagsAnim.SetScaledAnimationSpeed(); + cakeBagAnim.SetScaledAnimationSpeed(); + donutBagAnim.SetScaledAnimationSpeed(); + windAnim.SetScaledAnimationSpeed(); + } + + private bool _emotionCancelled = false; + private int _emotionIndex = 0; + private List _allEmotionsStretch = new(); + private EmotionStretchType _lastEmotion = EmotionStretchType.LookUp; + + private void UpdateEmotions() + { + var cond = Conductor.instance; + if (_allEmotionsStretch.Count == 0 || _emotionIndex >= _allEmotionsStretch.Count) return; + + var beat = cond.songPositionInBeatsAsDouble; + + var e = _allEmotionsStretch[_emotionIndex]; + + if (beat > e.beat + e.length) + { + _emotionIndex++; + _lastEmotion = (EmotionStretchType)_allEmotionsStretch[_emotionIndex - 1]["type"]; + crying = _lastEmotion == EmotionStretchType.StartCrying; + _emotionCancelled = false; + UpdateEmotions(); + return; + } + + if (beat >= e.beat && beat < e.beat + e.length && !_emotionCancelled) + { + _lastEmotion = (EmotionStretchType)e["type"]; + crying = _lastEmotion == EmotionStretchType.StartCrying; + float normalizedBeat = cond.GetPositionFromBeat(e.beat, e.length); + + string animName = (EmotionStretchType)e["type"] switch + { + EmotionStretchType.LookUp => "OpenEyes", + EmotionStretchType.Smile => "Smile", + EmotionStretchType.StartCrying => "Sad", + _ => throw new NotImplementedException(), + }; + headAndBodyAnim.DoNormalizedAnimation(animName, normalizedBeat); + } + } + + private void HandleEmotions(double beat) + { + _allEmotionsStretch = EventCaller.GetAllInGameManagerList("blueBear", new string[] { "stretchEmotion" }); + if (_allEmotionsStretch.Count == 0) return; + UpdateEmotions(); + var allEmosBeforeBeat = EventCaller.GetAllInGameManagerList("blueBear", new string[] { "stretchEmotion" }).FindAll(x => x.beat < beat); + + if ((EmotionStretchType)allEmosBeforeBeat[^1]["type"] == EmotionStretchType.StartCrying) + { + headAndBodyAnim.DoScaledAnimationAsync("CryIdle", 0.5f); + } + else if ((EmotionStretchType)allEmosBeforeBeat[^1]["type"] == EmotionStretchType.Smile) + { + headAndBodyAnim.DoScaledAnimationAsync("SmileIdle", 0.5f); + } } public override void OnPlay(double beat) { HandleTreatsOnStart(beat); + HandleEmotions(beat); } public override void OnGameSwitch(double beat) { HandleTreatsOnStart(beat); + HandleEmotions(beat); } private void HandleTreatsOnStart(double gameswitchBeat) @@ -302,18 +396,19 @@ namespace HeavenStudio.Games public void Wind() { - windAnim.Play("Wind", 0, 0); + windAnim.DoScaledAnimationAsync("Wind", 0.5f); } public void Bite(bool left) { + _emotionCancelled = true; if (crying) { - headAndBodyAnim.Play(left ? "CryBiteL" : "CryBiteR", 0, 0); + headAndBodyAnim.DoScaledAnimationAsync(left ? "CryBiteL" : "CryBiteR", 0.5f); } else { - headAndBodyAnim.Play(left ? "BiteL" : "BiteR", 0, 0); + headAndBodyAnim.DoScaledAnimationAsync(left ? "BiteL" : "BiteR", 0.5f); } } @@ -358,58 +453,31 @@ namespace HeavenStudio.Games if (noDonutSquash && noCakeSquash) { squashing = false; - bagsAnim.Play("Idle", 0, 0); + bagsAnim.DoScaledAnimationAsync("Idle", 0.5f); } } } - public void SetEmotion(double beat, float length, int emotion) + public void SetEmotion(int emotion) { + _emotionCancelled = true; switch (emotion) { case (int)EmotionType.Neutral: - if (emotionAnimName == "Smile") - { - headAndBodyAnim.Play("StopSmile", 0, 0); - emotionAnimName = ""; - } - else - { - headAndBodyAnim.Play("Idle", 0, 0); - } + //check if smiling then play "StopSmile" + headAndBodyAnim.DoScaledAnimationAsync("Idle", 0.5f); crying = false; break; case (int)EmotionType.ClosedEyes: - headAndBodyAnim.Play("EyesClosed", 0, 0); + headAndBodyAnim.DoScaledAnimationAsync("EyesClosed", 0.5f); crying = false; break; - case (int)EmotionType.LookUp: - emotionStartBeat = beat; - emotionLength = length; - emotionAnimName = "OpenEyes"; - headAndBodyAnim.Play(emotionAnimName, 0, 0); - crying = false; - break; - case (int)EmotionType.Smile: - emotionStartBeat = beat; - emotionLength = length; - emotionAnimName = "Smile"; - headAndBodyAnim.Play(emotionAnimName, 0, 0); - crying = false; - break; - case (int)EmotionType.Sad: - emotionStartBeat = beat; - emotionLength = length; - emotionAnimName = "Sad"; - headAndBodyAnim.Play(emotionAnimName, 0, 0); - crying = true; - break; - case (int)EmotionType.InstaSad: - headAndBodyAnim.Play("CryIdle", 0, 0); + case (int)EmotionType.Cry: + headAndBodyAnim.DoScaledAnimationAsync("CryIdle", 0.5f); crying = true; break; case (int)EmotionType.Sigh: - headAndBodyAnim.Play("Sigh", 0, 0); + headAndBodyAnim.DoScaledAnimationAsync("Sigh", 0.5f); crying = false; break; default: @@ -424,7 +492,6 @@ namespace HeavenStudio.Games var treatComp = newTreat.GetComponent(); treatComp.startBeat = beat; - treatComp.curve = isCake ? cakeCurve : donutCurve; newTreat.SetActive(true); @@ -439,17 +506,17 @@ namespace HeavenStudio.Games public void SquashBag(bool isCake) { squashing = true; - bagsAnim.Play("Squashing", 0, 0); + bagsAnim.DoScaledAnimationAsync("Squashing", 0.5f); individualBagHolder.SetActive(true); if (isCake) { - cakeBagAnim.Play("CakeSquash", 0, 0); + cakeBagAnim.DoScaledAnimationAsync("CakeSquash", 0.5f); } else { - donutBagAnim.Play("DonutSquash", 0, 0); + donutBagAnim.DoScaledAnimationAsync("DonutSquash", 0.5f); } } } diff --git a/Assets/Scripts/Games/BlueBear/Treat.cs b/Assets/Scripts/Games/BlueBear/Treat.cs index a4adcf51..5d5e3f87 100644 --- a/Assets/Scripts/Games/BlueBear/Treat.cs +++ b/Assets/Scripts/Games/BlueBear/Treat.cs @@ -8,17 +8,18 @@ using HeavenStudio.Util; namespace HeavenStudio.Games.Scripts_BlueBear { - public class Treat : MonoBehaviour + public class Treat : SuperCurveObject { - const float rotSpeed = 360f; + const float barelyDistX = 1.5f; + const float barelyDistY = -6f; + const float barelyHeight = 4f; + const float rotSpeed = 360f * 3; public bool isCake; public double startBeat; - - bool flying = true; double flyBeats; - [NonSerialized] public BezierCurve3D curve; + private Path path; private BlueBear game; @@ -30,33 +31,34 @@ namespace HeavenStudio.Games.Scripts_BlueBear private void Start() { flyBeats = isCake ? 3f : 2f; + Path pathToCopy = isCake ? game.GetPath("Cake") : game.GetPath("Donut"); + path = new(); + path.positions = new PathPos[2]; + path.positions[0].pos = pathToCopy.positions[0].pos; + path.positions[0].duration = pathToCopy.positions[0].duration; + path.positions[0].height = pathToCopy.positions[0].height; + path.positions[1].pos = pathToCopy.positions[1].pos; game.ScheduleInput(startBeat, flyBeats, isCake ? BlueBear.InputAction_Left : BlueBear.InputAction_Right, Just, Out, Out); + Update(); } private void Update() { - if (flying) + var cond = Conductor.instance; + transform.localPosition = GetPathPositionFromBeat(path, cond.songPositionInBeatsAsDouble, startBeat); + + float flyPos = cond.GetPositionFromBeat(startBeat, flyBeats); + if (flyPos > 2f) { - var cond = Conductor.instance; - - float flyPos = cond.GetPositionFromBeat(startBeat, flyBeats); - flyPos *= isCake ? 0.75f : 0.6f; - transform.position = curve.GetPoint(flyPos); - - if (flyPos > 1f) - { - Destroy(gameObject); - return; - } - - float rot = isCake ? rotSpeed : -rotSpeed; - transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (rot * Time.deltaTime)); + Destroy(gameObject); + return; } + + float rot = isCake ? rotSpeed : -rotSpeed; + transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (rot * Time.deltaTime * cond.pitchedSecPerBeat)); } void EatFood() { - flying = false; - if (isCake) { SoundByte.PlayOneShotGame("blueBear/chompCake"); @@ -71,21 +73,28 @@ namespace HeavenStudio.Games.Scripts_BlueBear SpawnCrumbs(); - GameObject.Destroy(gameObject); + Destroy(gameObject); } private void Just(PlayerActionEvent caller, float state) { if (state >= 1f || state <= -1f) - { //todo: proper near miss feedback + { + SoundByte.PlayOneShot("miss"); if (isCake) { - game.headAndBodyAnim.Play("BiteL", 0, 0); + game.headAndBodyAnim.DoScaledAnimationAsync("BiteL", 0, 0); } else { - game.headAndBodyAnim.Play("BiteR", 0, 0); + game.headAndBodyAnim.DoScaledAnimationAsync("BiteR", 0, 0); } + path.positions[0].pos = transform.localPosition; + path.positions[0].height = barelyHeight; + path.positions[0].duration = 1; + path.positions[1].pos = new Vector3(path.positions[0].pos.x + (isCake ? -barelyDistX : barelyDistX), path.positions[0].pos.y + barelyDistY); + startBeat = Conductor.instance.songPositionInBeatsAsDouble; + Update(); return; } EatFood(); @@ -104,7 +113,7 @@ namespace HeavenStudio.Games.Scripts_BlueBear var newGradient = new ParticleSystem.MinMaxGradient(isCake ? game.cakeGradient : game.donutGradient); newGradient.mode = ParticleSystemGradientMode.RandomColor; main.startColor = newGradient; - ps.Play(); + ps.PlayScaledAsync(1); } } } diff --git a/Assets/Scripts/Util/AnimationHelpers.cs b/Assets/Scripts/Util/AnimationHelpers.cs index 72351355..093c9329 100644 --- a/Assets/Scripts/Util/AnimationHelpers.cs +++ b/Assets/Scripts/Util/AnimationHelpers.cs @@ -90,6 +90,11 @@ namespace HeavenStudio.Util anim.speed = (1f / Conductor.instance.pitchedSecPerBeat) * timeScale; } + public static void SetScaledAnimationSpeed(this Animator anim, float timeScale = 0.5f) + { + anim.speed = (1f / Conductor.instance.pitchedSecPerBeat) * timeScale; + } + /// /// Plays animation on animator, at default speed /// this is the least nessecary function here lol