void Start() { FXAudio.Init(); MusicAudio.Init(); offset = transform.position - player.transform.position; }
public void PlayMusic(MusicAudio music) { AudioClip musicToPlay = Resources.Load <AudioClip>("Audio/Music/" + music.ToString()); asi_BGM.Clip = musicToPlay; asi_BGM.PlayFromStart(); }
private void MusicVolumeSliderValueChanged(float value) { if (musicVolumeSlider != null) { MusicAudio.SetVolume(value / musicVolumeSlider.maxValue); } }
void Start() { MusicAudio.Init(); if (titleText == null) { Transform t = gameObject.transform.Find("TitleText"); if (t != null) { titleText = t.gameObject.GetComponent <Text> (); } } restartButton.onClick.AddListener(RestartGame); mainMenuButton.onClick.AddListener(GoToMainMenu); quitButton.onClick.AddListener(Application.Quit); nextButton.onClick.AddListener(NextLevel); if (GameState.GetCurrentState() != GameState.ResultType.WIN) { nextButton.enabled = false; nextButton.gameObject.SetActive(false); } UpdateText(); }
void Start() { if (Time.timeScale == 0.0f) { Time.timeScale = 1.0f; } FXAudio.Init(); MusicAudio.Init(); InitMainMenuButtons(); InitSettingsPanelAndButtons(); LoadSettings(); }
private void Start() { musicAudioScr = transform.parent.GetComponent <MusicAudio>(); }