private void Start() { _swipeControls = GetComponent <SwipeControls>(); _tapScreen = GetComponent <TapScreen>(); _menuSounds = GetComponent <MenuSounds>(); //_menuSounds.playSound(0); }
// Use this for initialization void Start() { _sounds = GameObject.Find("LC").GetComponent<MenuSounds>(); _aSource = GameObject.Find("LC").GetComponent<AudioSource>(); _b = GetComponent<Button>(); _b.onClick.AddListener(() => { Application.Quit(); }); }
public void playSound(MenuSounds soundType) { if (bSoundEnabled) { asMenuSounds[(int)soundType].Play(); } }
void Start() { _sounds = GameObject.Find("LC").GetComponent<MenuSounds>(); _aSource = GameObject.Find("LC").GetComponent<AudioSource>(); _b = GetComponent<Button>(); _b.onClick = new Button.ButtonClickedEvent(); _b.onClick.AddListener(() => { NewGame(); }); }
/// <summary> /// Constructor. Sets up the sound and canvas/panel. Loads button prefab and then loads the buttons. /// </summary> /// <param name="MenuSounds">Reference to the MenuSounds object</param> public BuildMainMenu(MenuSounds MenuSounds) { menuSounds = MenuSounds; menuSounds.StartMenuSounds(); canvasPanel = new CanvasPanel(); buttonPrefab = Resources.Load <GameObject>(strButtonPrefab); MainMenuLoad(); }
// Use this for initialization void Start() { _sounds = GameObject.Find("LC").GetComponent<MenuSounds>(); _aSource = GameObject.Find("LC").GetComponent<AudioSource>(); _b = GetComponent<Button>(); _b.interactable = PlayerPrefs.HasKey("LastLevel"); _b.onClick.AddListener(() => { Application.LoadLevel(PlayerPrefs.GetInt("LastLevel")); }); }
public bool isPlaying(MenuSounds sound) { if (asMenuSounds[(int)sound].isPlaying) { return(true); } else { return(false); } }
void Awake() { if (sound == null) { DontDestroyOnLoad(gameObject); sound = this; } else if (sound != this) { Destroy(gameObject); } }
public BuildOptionsMenu(MenuSounds MenuSounds, CanvasPanel ParentMenu) { eventTrigger = null; parentMenu = ParentMenu; menuSounds = MenuSounds; menuSounds.StartMenuSounds(); canvasPanel = new CanvasPanel(); sliderPrefab = Resources.Load <GameObject>(strSliderPrefab); buttonPrefab = Resources.Load <GameObject>(strButtonPrefab); OptionsMenuLoad(); }
public BuildSaveLoadMenu(MenuSounds MenuSounds, CanvasPanel ParentMenu) { eventTrigger = null; parentMenu = ParentMenu; menuSounds = MenuSounds; menuSounds.StartMenuSounds(); canvasPanel = new CanvasPanel(); buttonPrefab = Resources.Load <GameObject>(strButtonPrefab); saveLoadPrefab = Resources.Load <GameObject>(strSaveLoadPrefab); LoadSaveLoadMenu(); }
//Function to handle event OnButtonActivate public void HandleButtonActivate(VRMenuButton button) { MenuSounds.PlayOneShot("CLICK", 0); if (button.m_ScreenSelection == ScreenTypes.None) { return; } if (button.m_ScreenSelection == ScreenTypes.Back) { PreviousScreen(); } else { EnableScreen(button.m_ScreenSelection); } }
/* * FUNCTION: Stops all sounds except background music */ public void stopAllSounds() { for (int i = 0; i < CharacterSounds.GetValues(typeof(CharacterSounds)).Length; i++) { asCharacterSounds [i].Stop(); } for (int i = 0; i < PowerupSounds.GetValues(typeof(PowerupSounds)).Length; i++) { asPowerupSounds [i].Stop(); } for (int i = 0; i < MenuSounds.GetValues(typeof(MenuSounds)).Length; i++) { asMenuSounds [i].Stop(); } for (int i = 0; i < EnemySounds.GetValues(typeof(EnemySounds)).Length; i++) { asEnemySounds [i].Stop(); } bFootstepsPlaying = false; }
public bool isPlaying (MenuSounds sound) { if (asMenuSounds [(int)sound].isPlaying) return true; else return false; }
public void stopSound (MenuSounds soundType) { asMenuSounds [(int)soundType].Stop (); }
public void playSound (MenuSounds soundType) { if (bSoundEnabled) asMenuSounds [(int)soundType].Play (); }
// Use this for initialization void Start() { m_audioSource = GetComponent <AudioSource> (); sounds = GetComponentInParent <MenuSounds> (); }
// Use this for initialization void Start() { ms = GameObject.Find("Sounds").GetComponent <MenuSounds>(); }
void Start() { currentMenu.Add(Menus.MAIN_MENU, mainMenuTexts); //currentMenu.Add(Menus.OPTIONS, optionMenuTexts); currentMenu.Add(Menus.CREDITS, miscTexts); currentMenu.Add(Menus.CONTROLS, controlMenuTexts); currentMenu.Add(Menus.CONTROLSXBOX, miscTexts); currentMenu.Add(Menus.CONTROLSKEYBOARD, miscTexts); GUIMenu = Menus.MAIN_MENU; PlayerPrefs.SetFloat("MusicVolume", 1.00f); musicValue = PlayerPrefs.GetFloat("MusicVolume"); PlayerPrefs.SetFloat("SoundVolume", 1.00f); soundValue = PlayerPrefs.GetFloat("SoundVolume"); menuSounds = GameObject.Find("MainMenuSounds").GetComponent<MenuSounds>(); }
public void stopSound(MenuSounds soundType) { asMenuSounds[(int)soundType].Stop(); }
private void Awake() { menuSounds = new MenuSounds(); buildMainMenu = new BuildMainMenu(menuSounds); }