/* --- Methods --- */ // Use this for initialization new void Start() { base.Start(); stage = -1; active = false; self = this; }
public override void update() { // fade out normal bgm if (fadeout) { if (inst.bgmASrc.volume > 0) { inst.bgmASrc.volume -= (Time.deltaTime * inst.DEFAULT_VOLUME / (inst.bossBGMFadeDuration + 0.1f)); } else { fadeout = false; inst.bgmASrc.Stop(); } } // fade in boss bgm if (fadein) { if (bossASrc.volume < inst.DEFAULT_VOLUME) { bossASrc.volume += (Time.deltaTime * inst.DEFAULT_VOLUME / (inst.bossBGMFadeDuration + 0.1f)); } else { fadein = false; } } // next stage if (!bossASrc.isPlaying && iAudio <= inst.aBoss.Length - 1) { if (iAudio == 0) { BossMelody.Activate(); iAudio++; } bossASrc.clip = inst.aBoss[iAudio]; bossASrc.Play(); bossASrc.loop = true; } }