LoopingFix
This commit is contained in:
parent
3fd5637ec9
commit
42bf9150ae
2 changed files with 6 additions and 4 deletions
|
@ -13,6 +13,8 @@ public class AudioControl : MonoBehaviour
|
|||
public enum Sfx { shoot, explosion, mobattack };
|
||||
|
||||
private const float lvlbgm = 37.879f;
|
||||
private const float gobgm = 14.406f;
|
||||
private const float loopdelay = 0.05f;
|
||||
private bool menu;
|
||||
|
||||
// Use this for initialization
|
||||
|
@ -20,15 +22,14 @@ public class AudioControl : MonoBehaviour
|
|||
{
|
||||
maintheme.loop = true;
|
||||
gameovers.loop = true;
|
||||
maintheme.Play();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (maintheme.time >= 99.0f)
|
||||
if (maintheme.time >= maintheme.clip.length - loopdelay)
|
||||
maintheme.time = lvlbgm;
|
||||
if (gameovers.time >= 22.85f)
|
||||
gameovers.time = 3;
|
||||
if (gameovers.time >= gameovers.clip.length - loopdelay)
|
||||
gameovers.time = gobgm;
|
||||
}
|
||||
|
||||
public void GameOverBgm()
|
||||
|
|
|
@ -71,6 +71,7 @@ AudioMixerSnapshotController:
|
|||
m_SnapshotID: d3789ccdbdc046a448f1887d94c3f7f5
|
||||
m_FloatValues:
|
||||
25123d234de4ec84aafee1d0c380f3ad: 0.025578512
|
||||
7e224658afaf14242ba3996793ac12a1: -7.436929
|
||||
m_TransitionOverrides: {}
|
||||
--- !u!243 &243067197919102372
|
||||
AudioMixerGroupController:
|
||||
|
|
Loading…
Add table
Reference in a new issue