bread2unity BCCAD interpreter setup

This commit is contained in:
Braedon
2022-02-10 03:13:54 -05:00
parent 5dc432a9d9
commit 772ab2783c
19 changed files with 541 additions and 108 deletions

View File

@ -17,6 +17,7 @@ namespace RhythmHeavenMania.Games.RhythmTweezers
public Animator VegetableAnimator;
public Tweezers Tweezers;
public GameObject hairBase;
public GameObject longHairBase;
[SerializeField] private GameObject HairsHolder;
[NonSerialized] public int hairsLeft = 0;
@ -57,6 +58,25 @@ namespace RhythmHeavenMania.Games.RhythmTweezers
hairsLeft++;
}
public void SpawnLongHair(float beat)
{
StopTransitionIfActive();
if (!intervalStarted)
{
SetIntervalStart(beat, beatInterval);
}
Jukebox.PlayOneShotGame("rhythmTweezers/longAppear", beat);
LongHair hair = Instantiate(longHairBase, HairsHolder.transform).GetComponent<LongHair>();
hair.gameObject.SetActive(true);
float rot = -58f + 116 * Mathp.Normalize(beat, intervalStartBeat, intervalStartBeat + beatInterval - 1f);
hair.transform.eulerAngles = new Vector3(0, 0, rot);
hair.createBeat = beat;
hairsLeft++;
}
public void SetIntervalStart(float beat, float interval = 4f)
{
// End transition early if the interval starts a lil early.