public void PlayMusic(string nextState) { MUSIC_STATE _nextState = (MUSIC_STATE)Enum.Parse(typeof(MUSIC_STATE), nextState); // If states are the same, dont do nothing if (_nextState == this.state) { return; } switch (_nextState) { case MUSIC_STATE.BATTLE: SetCurrentBGM(battleMusic); Play(); break; case MUSIC_STATE.FIELD: SetCurrentBGM(fieldMusic); Play(); break; default: break; } state = _nextState; }
public void Stop() { state = MUSIC_STATE.NONE; audioSource.Stop(); }
public void setMusicIdle() { _currentState = MUSIC_STATE.IDLE; }
public void setMusicPlaying() { _currentState = MUSIC_STATE.PLAYING; }