From 3eeb1562a968a5bfa1a3176b8959cde19b976498 Mon Sep 17 00:00:00 2001 From: kimura Date: Thu, 30 Jun 2022 18:35:48 +0900 Subject: [PATCH] =?UTF-8?q?update=20=E3=81=93=E3=81=91=E3=81=9F=E3=81=A8?= =?UTF-8?q?=E3=81=8D=E3=81=AE=E8=B7=B3=E3=81=AD=E8=BB=8C=E9=81=93=E3=82=92?= =?UTF-8?q?=20AnimationCurve=E6=96=B9=E5=BC=8F=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MiniGame/Prefabs/Brother_pink.prefab | 33 +++++++++++++++++++ .../MyGame/Scenes/MiniGame/Scripts/Player.cs | 4 +-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/MiniGame/Prefabs/Brother_pink.prefab b/popcorn/Assets/MyGame/Scenes/MiniGame/Prefabs/Brother_pink.prefab index 04f6dd04..b4c17ef8 100644 --- a/popcorn/Assets/MyGame/Scenes/MiniGame/Prefabs/Brother_pink.prefab +++ b/popcorn/Assets/MyGame/Scenes/MiniGame/Prefabs/Brother_pink.prefab @@ -550,6 +550,39 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 0 m_RotationOrder: 4 + hitAnimationCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 6.026828 + outSlope: 6.026828 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0.08312589 + - serializedVersion: 3 + time: 0.30518538 + value: 1.9853464 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: -2.3362193 + outSlope: -2.3362193 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.05080726 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 level1: {fileID: 775281020594132328} level2: {fileID: 7545235244005095164} level3: {fileID: 3741799588110921262} diff --git a/popcorn/Assets/MyGame/Scenes/MiniGame/Scripts/Player.cs b/popcorn/Assets/MyGame/Scenes/MiniGame/Scripts/Player.cs index 68eeb3ef..68cb09b6 100644 --- a/popcorn/Assets/MyGame/Scenes/MiniGame/Scripts/Player.cs +++ b/popcorn/Assets/MyGame/Scenes/MiniGame/Scripts/Player.cs @@ -12,6 +12,7 @@ namespace MyGame.Scenes.MiniGame.Scripts [SerializeField] private float hitTime = 1.5f; [SerializeField] private float hitWaitTime = 1f; [SerializeField] private AnimationCurve jumpAnimationCurve; + [SerializeField] private AnimationCurve hitAnimationCurve; [SerializeField] private GameObject level1; [SerializeField] private GameObject level2; [SerializeField] private GameObject level3; @@ -91,8 +92,7 @@ namespace MyGame.Scenes.MiniGame.Scripts var diffHeight = transform.localPosition.y - basePos.y; jumpCoroutine = this.CallLerp(diffHeight == 0f ? 0f : fallTime, t => { - var half = 0.5f + t / 2; - transform.SetLocalPositionY(basePos.y + Mathf.Sin(Mathf.PI * half) * diffHeight); + transform.SetLocalPositionY(basePos.y + hitAnimationCurve.Evaluate(t) * diffHeight); }, () => { isJump = false;