remify minigame CatsRhythmGame
This commit is contained in:
31
Assets/GUIPackCartoon/Demo/Scripts/MuteBackgroundMusic.cs
Normal file
31
Assets/GUIPackCartoon/Demo/Scripts/MuteBackgroundMusic.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright (C) 2015 ricimi - All rights reserved.
|
||||
// This code can only be used under the standard Unity Asset Store End User License Agreement.
|
||||
// A Copy of the Asset Store EULA is available at http://unity3d.com/company/legal/as_terms.
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ricimi
|
||||
{
|
||||
// This class is responsible for fading the currently playing background music.
|
||||
public class MuteBackgroundMusic : MonoBehaviour
|
||||
{
|
||||
private BackgroundMusic m_bgMusic;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
var backgroundMusic = GameObject.Find("BackgroundMusic");
|
||||
if (backgroundMusic != null)
|
||||
{
|
||||
m_bgMusic = backgroundMusic.GetComponent<BackgroundMusic>();
|
||||
if (m_bgMusic != null)
|
||||
m_bgMusic.FadeOut();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (m_bgMusic != null)
|
||||
m_bgMusic.FadeIn();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user