mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 08:17:38 +02:00
Was unable to clap more than once at a time
This commit is contained in:
@ -30,15 +30,6 @@ namespace RhythmHeavenMania.Games.ClappyTrio
|
|||||||
instance = this;
|
instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnGameSwitch()
|
|
||||||
{
|
|
||||||
// for (int i = 0; i < Lion.Count; i++)
|
|
||||||
// {
|
|
||||||
// SetFace(i, 0);
|
|
||||||
// }
|
|
||||||
// PlayAnimationAll("Idle");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
float maxWidth = 9.2f;
|
float maxWidth = 9.2f;
|
||||||
@ -66,18 +57,6 @@ namespace RhythmHeavenMania.Games.ClappyTrio
|
|||||||
ClappyTrioPlayer = lion.AddComponent<ClappyTrioPlayer>();
|
ClappyTrioPlayer = lion.AddComponent<ClappyTrioPlayer>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*LionMiddle = Instantiate(LionLeft, LionLeft.transform.parent);
|
|
||||||
LionMiddle.transform.localPosition = new Vector3(3.1f, 0);
|
|
||||||
|
|
||||||
LionPlayer = Instantiate(LionLeft, LionLeft.transform.parent);
|
|
||||||
LionPlayer.transform.localPosition = new Vector3(6.2f, 0);
|
|
||||||
ClappyTrioPlayer = LionPlayer.AddComponent<ClappyTrioPlayer>();
|
|
||||||
|
|
||||||
|
|
||||||
lionHeadLeft = LionLeft.transform.GetChild(1).GetComponent<SpriteRenderer>();
|
|
||||||
lionHeadMiddle = LionMiddle.transform.GetChild(1).GetComponent<SpriteRenderer>();
|
|
||||||
lionHeadPlayer = LionPlayer.transform.GetChild(1).GetComponent<SpriteRenderer>();*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
@ -124,35 +103,6 @@ namespace RhythmHeavenMania.Games.ClappyTrio
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (songPosBeat > lastClapStart && songPosBeat < lastClapStart + 1 && clapIndex == 0)
|
|
||||||
{
|
|
||||||
Debug.Log(Conductor.instance.songPositionInBeats);
|
|
||||||
SetFace(0, 4);
|
|
||||||
Lion[0].GetComponent<Animator>().Play("Clap", 0, 0);
|
|
||||||
Jukebox.PlayOneShotGame("clappyTrio/leftClap");
|
|
||||||
|
|
||||||
clapIndex++;
|
|
||||||
}
|
|
||||||
else if (songPosBeat > lastClapStart + currentClappingLength && songPosBeat < lastClapStart + (currentClappingLength * 2) && clapIndex == 1)
|
|
||||||
{
|
|
||||||
Debug.Log(Conductor.instance.songPositionInBeats);
|
|
||||||
SetFace(1, 4);
|
|
||||||
Lion[1].GetComponent<Animator>().Play("Clap", 0, 0);
|
|
||||||
Jukebox.PlayOneShotGame("clappyTrio/middleClap");
|
|
||||||
|
|
||||||
clapIndex++;
|
|
||||||
}
|
|
||||||
else if (songPosBeat > lastClapStart + (currentClappingLength * 2 - 0.35f) && clapIndex == 2)
|
|
||||||
{
|
|
||||||
Debug.Log(Conductor.instance.songPositionInBeats);
|
|
||||||
ClappyTrioPlayer.SetClapAvailability(lastClapStart + (currentClappingLength * 2 - 0.35f));
|
|
||||||
|
|
||||||
clapIndex = 0;
|
|
||||||
isClapping = false;
|
|
||||||
currentClappingLength = 0;
|
|
||||||
ClappyTrioPlayer.clapStarted = false;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,10 +12,6 @@ namespace RhythmHeavenMania.Games.ClappyTrio
|
|||||||
private float lastClapLength;
|
private float lastClapLength;
|
||||||
[SerializeField] private bool clapVacant;
|
[SerializeField] private bool clapVacant;
|
||||||
|
|
||||||
private int lastIndex;
|
|
||||||
|
|
||||||
private bool hit;
|
|
||||||
|
|
||||||
public bool clapStarted = false;
|
public bool clapStarted = false;
|
||||||
public bool canHit;
|
public bool canHit;
|
||||||
|
|
||||||
@ -44,10 +40,9 @@ namespace RhythmHeavenMania.Games.ClappyTrio
|
|||||||
|
|
||||||
StateCheck(normalizedBeat);
|
StateCheck(normalizedBeat);
|
||||||
|
|
||||||
if (normalizedBeat > Minigame.LateTime())
|
if (normalizedBeat > Minigame.EndTime())
|
||||||
{
|
{
|
||||||
clapVacant = false;
|
clapVacant = false;
|
||||||
lastIndex = 0;
|
|
||||||
lastClapLength = 0;
|
lastClapLength = 0;
|
||||||
lastClapBeat = 0;
|
lastClapBeat = 0;
|
||||||
}
|
}
|
||||||
@ -66,13 +61,13 @@ namespace RhythmHeavenMania.Games.ClappyTrio
|
|||||||
lastClapBeat = startBeat;
|
lastClapBeat = startBeat;
|
||||||
clapVacant = true;
|
clapVacant = true;
|
||||||
lastClapLength = length;
|
lastClapLength = length;
|
||||||
|
|
||||||
|
ResetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Clap(bool overrideCanHit)
|
private void Clap(bool overrideCanHit)
|
||||||
{
|
{
|
||||||
bool canHit = state.early != true && state.late != true && state.perfect == true && hit == false;
|
if (state.early || state.perfect || overrideCanHit)
|
||||||
|
|
||||||
if (canHit || overrideCanHit)
|
|
||||||
{
|
{
|
||||||
clapEffect.SetActive(true);
|
clapEffect.SetActive(true);
|
||||||
Jukebox.PlayOneShotGame("clappyTrio/rightClap");
|
Jukebox.PlayOneShotGame("clappyTrio/rightClap");
|
||||||
|
Reference in New Issue
Block a user