コード例 #1
0
 // Use the singleton pattern to manage playing audio for powerups.
 // This allows us to keep track of whether audio is playing, and stop the existing audio if it is
 public static PowerupSoundManager getInstance()
 {
     if (instance == null)
     {
         instance = new PowerupSoundManager();
         aSource  = GameObject.Find("AudioManagement").GetComponent <AudioManagement>();
     }
     return(instance);
 }
コード例 #2
0
 void Start()
 {
     soundManager = PowerupSoundManager.getInstance();
     StopAudio    = soundManager.StopAudio;
 }