update こけたときの跳ね軌道を AnimationCurve方式に変更
This commit is contained in:
parent
8297c1e493
commit
3eeb1562a9
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue