mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 03:35:10 +00:00
Fan Club: prepare Arisa jumping
This commit is contained in:
parent
04535747f7
commit
6d857e9d5c
1 changed files with 32 additions and 0 deletions
|
@ -33,6 +33,7 @@ namespace HeavenStudio.Games
|
|||
|
||||
[Header("Objects")]
|
||||
public GameObject Arisa;
|
||||
public GameObject ArisaShadow;
|
||||
public ParticleSystem idolClapEffect;
|
||||
public GameObject spectator;
|
||||
public GameObject spectatorAnchor;
|
||||
|
@ -56,6 +57,8 @@ namespace HeavenStudio.Games
|
|||
private static float wantHais = Single.MinValue;
|
||||
private static float wantKamone = Single.MinValue;
|
||||
private static float wantBigReady = Single.MinValue;
|
||||
public float idolJumpStartTime = Single.MinValue;
|
||||
private bool hasJumped = false;
|
||||
|
||||
//game scene
|
||||
public static FanClub instance;
|
||||
|
@ -151,6 +154,30 @@ namespace HeavenStudio.Games
|
|||
}
|
||||
}
|
||||
|
||||
//idol jumping physics
|
||||
float jumpPos = cond.GetPositionFromBeat(jumpStartTime, 1f);
|
||||
float IDOL_SHADOW_SCALE = 1f;
|
||||
if (cond.songPositionInBeats >= jumpStartTime && cond.songPositionInBeats < jumpStartTime + 1f)
|
||||
{
|
||||
hasJumped = true;
|
||||
float yMul = jumpPos * 2f - 1f;
|
||||
float yWeight = -(yMul*yMul) + 1f;
|
||||
//TODO: idol start position
|
||||
Arisa.transform.localPosition = new Vector3(0, 3f * yWeight);
|
||||
ArisaShadow.transform.localScale = new Vector3((1f-yWeight*0.8f) * IDOL_SHADOW_SCALE, (1f-yWeight*0.8f) * IDOL_SHADOW_SCALE, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hasJumped)
|
||||
{
|
||||
DisableBop(cond.songPositionInBeats, 1.5);
|
||||
//TODO: landing anim
|
||||
}
|
||||
jumpStartTime = Single.MinValue;
|
||||
//TODO: idol start position
|
||||
Arisa.transform.localPosition = new Vector3(0, 0);
|
||||
ArisaShadow.transform.localScale = new Vector3(IDOL_SHADOW_SCALE, IDOL_SHADOW_SCALE, 1f);
|
||||
}
|
||||
}
|
||||
|
||||
public void Bop(float beat, float length, int target = (int) IdolBopType.Both)
|
||||
|
@ -240,6 +267,11 @@ namespace HeavenStudio.Games
|
|||
|
||||
private void DoIdolJump(float beat)
|
||||
{
|
||||
DisableBop(beat, 1f);
|
||||
DisableResponse(beat, 1f);
|
||||
idolJumpStartTime = beat;
|
||||
|
||||
//play anim
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue