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(); });
 }
Beispiel #3
0
 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(); });
 }
Beispiel #5
0
    /// <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"));
     });
 }
Beispiel #7
0
 public bool isPlaying(MenuSounds sound)
 {
     if (asMenuSounds[(int)sound].isPlaying)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #8
0
 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();
    }
Beispiel #10
0
    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();
    }
Beispiel #11
0
            //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);
                }
            }
Beispiel #12
0
    /*
     *	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 ();
	}
Beispiel #16
0
 // Use this for initialization
 void Start()
 {
     m_audioSource = GetComponent <AudioSource> ();
     sounds        = GetComponentInParent <MenuSounds> ();
 }
Beispiel #17
0
 // Use this for initialization
 void Start()
 {
     ms = GameObject.Find("Sounds").GetComponent <MenuSounds>();
 }
Beispiel #18
0
    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>();
    }
Beispiel #19
0
 public void stopSound(MenuSounds soundType)
 {
     asMenuSounds[(int)soundType].Stop();
 }
Beispiel #20
0
 private void Awake()
 {
     menuSounds    = new MenuSounds();
     buildMainMenu = new BuildMainMenu(menuSounds);
 }