Beispiel #1
0
 private void Start()
 {
     animBS       = GetComponent <BeatSystem>();
     animInstance = FMODUnity.RuntimeManager.CreateInstance("event:/animation");
     animBS.AssignBeatEvent(animInstance);
     animInstance.start();
 }
Beispiel #2
0
    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();
    }
Beispiel #3
0
 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();
 }
Beispiel #4
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            instance.start();
            bS.AssignBeatEvent(instance);
        }

        if (Input.GetKeyDown(KeyCode.Z))
        {
            instance = FMODUnity.RuntimeManager.CreateInstance("event:/music");
            instance.start();
            bS.AssignBeatEvent(instance);
        }

        if (Input.GetKeyDown(KeyCode.LeftControl))
        {
            bS.StopAndClear(instance);
        }
    }
Beispiel #5
0
    void Start()
    {
        bS = GetComponent <BeatSystem>();

        if (AudioManager.Singleton.PlayEvent(clip))
        {
            instance = AudioManager.Singleton.GetEventInstance(clip);
        }

        bS.AssignBeatEvent(instance);
    }
Beispiel #6
0
 // Starts minigame music. I should probably rename this to StartMinigameMusic() to be more clear that this is ONLY meant to be used with BeatSystem attached music.
 public static void StartMusic()
 {
     _instance.start();
     bS.AssignBeatEvent(_instance);
 }