mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 03:35:10 +00:00
Merge branch 'release_1'
This commit is contained in:
commit
8174d3850b
1 changed files with 17 additions and 0 deletions
|
@ -43,6 +43,23 @@ namespace HeavenStudio.Util
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void LerpVolume(double beat, double length, float volumeStart, float volumeEnd)
|
||||||
|
{
|
||||||
|
if (!gameObject.activeSelf) return;
|
||||||
|
StartCoroutine(LerpVolumeCo(beat, length, volumeStart, volumeEnd));
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator LerpVolumeCo(double beat, double length, float volumeStart, float volumeEnd)
|
||||||
|
{
|
||||||
|
float normalized = 0;
|
||||||
|
while (normalized <= 1)
|
||||||
|
{
|
||||||
|
normalized = cond.GetPositionFromBeat(beat, length);
|
||||||
|
audioSource.volume = Mathf.Lerp(volumeStart, volumeEnd, normalized);
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Play()
|
public void Play()
|
||||||
{
|
{
|
||||||
if (!available)
|
if (!available)
|
||||||
|
|
Loading…
Reference in a new issue