mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 21:47:39 +02:00
Rockers + Rhythm Tweezers Call and Response API (#444)
* rock hers * Rockers is a real game and also color maps have been added * little more set up * anims and mor sprites * First version of CallAndResponseHandler added * You can mute now wow * Got some stuff working * anim city * Fixed Inputs * Visual goodies * Changed how some events work * Rockers is now stack proof * Fixed a bug * Bend early stages * bendbendbendbendbendover * bend fully implemented * Removed "noise" * pain * Many animation * Bend anims implemented * strum effect implemented * Made bends work way better * dfgdfsgsdffsd * Implemented strumstart and countin * hi * Made strumstart transition into strumidle * Implemented samples * All of the btsds samples are in now too * many anim2 * A buggy version of the custom together system has been implemented * Ok now it's unbuggified * fixed a small thing * lightning eff * anim fixes * oops * you can now mute voiceline and also put in a standalone voiceline block * Tweaks to dropdowns * more tiny anim thing * more animation stuff * Bug fixes * implemented mute and gotomiddle sliders for custom together event * Default cmon and last one added * You can chain last ones and cmons now * Applause sounds added * Fixed some bugs * Made it so you can disable camera movement * fixed an inconsistency * Rhythm tweezers is actually kinda playable now, not finished though, i need to make beat offset work with this * Rhythm tweezers now works between game switches * Beat offset eradication * Made eye size work properly * Camera quad ease rather than quint * Inactive intervals added * Rockers works inactively too now * Bug fix * No peeking! No way! * Alt smile added for tweezers * early and late riff * jj miss anim * icon and miss * Long hair works properly now * Miss anims implemented for rockers --------- Co-authored-by: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Co-authored-by: minenice55 <star.elementa@gmail.com>
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Starpelly;
|
||||
|
||||
namespace HeavenStudio.Util
|
||||
{
|
||||
@ -8,6 +9,7 @@ namespace HeavenStudio.Util
|
||||
{
|
||||
public AudioClip clip;
|
||||
public float pitch = 1;
|
||||
public float bendedPitch = 1; //only used with rockers
|
||||
public float volume = 1;
|
||||
|
||||
// For use with PlayOneShotScheduled
|
||||
@ -136,12 +138,69 @@ namespace HeavenStudio.Util
|
||||
audioSource.Stop();
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
{
|
||||
if (audioSource != null)
|
||||
audioSource.Pause();
|
||||
}
|
||||
|
||||
public void UnPause()
|
||||
{
|
||||
if (audioSource != null)
|
||||
audioSource.UnPause();
|
||||
}
|
||||
|
||||
public void Delete()
|
||||
{
|
||||
GameManager.instance.SoundObjects.Remove(gameObject);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
#region Bend
|
||||
// All of these should only be used with rockers.
|
||||
public void BendUp(float bendTime, float bendedPitch)
|
||||
{
|
||||
this.bendedPitch = bendedPitch;
|
||||
StartCoroutine(BendUpLoop(bendTime));
|
||||
}
|
||||
|
||||
public void BendDown(float bendTime)
|
||||
{
|
||||
StartCoroutine(BendDownLoop(bendTime));
|
||||
}
|
||||
|
||||
IEnumerator BendUpLoop(float bendTime)
|
||||
{
|
||||
float startingPitch = audioSource.pitch;
|
||||
float bendTimer = 0f;
|
||||
|
||||
while (bendTimer < bendTime)
|
||||
{
|
||||
bendTimer += Time.deltaTime;
|
||||
float normalizedProgress = Mathp.Normalize(bendTimer, 0, bendTime);
|
||||
float currentPitch = Mathf.Lerp(startingPitch, bendedPitch, normalizedProgress);
|
||||
audioSource.pitch = Mathf.Min(currentPitch, bendedPitch);
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator BendDownLoop(float bendTime)
|
||||
{
|
||||
float bendTimer = 0f;
|
||||
float startingPitch = pitch;
|
||||
|
||||
while (bendTimer < bendTime)
|
||||
{
|
||||
bendTimer += Time.deltaTime;
|
||||
float normalizedProgress = Mathp.Normalize(bendTimer, 0, bendTime);
|
||||
float currentPitch = Mathf.Lerp(startingPitch, bendedPitch, 1 - normalizedProgress);
|
||||
audioSource.pitch = Mathf.Max(currentPitch, pitch);
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void KillLoop(float fadeTime)
|
||||
{
|
||||
StartCoroutine(FadeLoop(fadeTime));
|
||||
|
Reference in New Issue
Block a user