private void Start() { animBS = GetComponent <BeatSystem>(); animInstance = FMODUnity.RuntimeManager.CreateInstance("event:/animation"); animBS.AssignBeatEvent(animInstance); animInstance.start(); }
public void Start() { // gets current scene/level name, so that the correct level bgm is played currentScene = SceneManager.GetActiveScene().name; switch (currentScene) { case "_Main_Menu": currentSongName = "startmenu"; break; case "Level_01": currentSongName = "lv01"; break; case "Level_02": currentSongName = "lv02"; break; case "Level_03": currentSongName = "lv03"; break; case "Level_04": currentSongName = "lv04"; break; default: currentSongName = null; break; } //Debug.Log(BeatSystem.bar); FMODUnity.RuntimeManager.StudioSystem.setParameterByName("MusicBarGlobal", BeatSystem.bar); bS = GameObject.Find("Main Camera").GetComponent <BeatSystem>(); bS.AssignBeatEvent(songInstance); // assigns path of current level's corresponding ability sound events sxSaw = "event:/Game/" + currentSongName + "/saw"; sxTri = "event:/Game/" + currentSongName + "/tri"; sxSqu = "event:/Game/" + currentSongName + "/squ"; sxSin = "event:/Game/" + currentSongName + "/sin"; // debug //Debug.Log(sxSaw); //Debug.Log(sxTri); //Debug.Log(sxSqu); //Debug.Log(sxSin); //Debug.Log("CURRENT SONG = " + currentSongName); //masterBus = FMODUnity.RuntimeManager.GetBus("bus:/Master"); musicBus = FMODUnity.RuntimeManager.GetBus("bus:/Master/Music"); // PLAY LEVEL BACKGROUND MUSIC PlayMusic(); }
public void PlayBossMusic() { // start beat system again // stop level music and start boss music musicBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); songInstance = FMODUnity.RuntimeManager.CreateInstance("event:/Music/bossbgm"); bS = GameObject.Find("Main Camera").GetComponent <BeatSystem>(); bS.AssignBeatEvent(songInstance); songInstance.start(); songInstance.release(); }
void Start() { bS = GetComponent <BeatSystem>(); if (AudioManager.Singleton.PlayEvent(clip)) { instance = AudioManager.Singleton.GetEventInstance(clip); } bS.AssignBeatEvent(instance); }
private void Awake() { if (instance != null && instance != this) { Destroy(gameObject); } else { instance = this; CalculateTimer(); ResetBeatCounter(); } }
// It appears that there is a significant delay when playing one shot noises from the player. Sound effects generated by player timing should // be passed into this class via GameManager based on our events, to make sure it syncs up with the song. // Start is called before the first frame update // Grabs the BeatSystem component attached to the GameObject. Must have a BeatSystem attached to the same object for Conductor to correctly function. // TODO: Error checking to ensure that the BeatSystem is attached to the same GameObject the Conductor is. void Start() { bS = GetComponent <BeatSystem>(); }