Created
March 14, 2018 14:26
-
-
Save WakkyFree/212393c78f04b3a112631b69851ca216 to your computer and use it in GitHub Desktop.
Unity script to control BGM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class BgmControl : MonoBehaviour { | |
public AudioSource myAudioSource; | |
// Use this for initialization | |
void Start () { | |
myAudioSource = GetComponent<AudioSource>(); | |
} | |
// Update is called once per frame | |
void Update () { | |
if(CountDownTimer.gameTimerInt == 0) { | |
myAudioSource.Stop(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment