Example #1
0
    void Start( )
    {
        Assert.IsNotNull(animator);
        Assert.IsNotNull(highlight);

        buttonSounds = GameObject.Find("ButtonSoundManager").GetComponent <ButtonSounds>( );
        Assert.IsNotNull(buttonSounds);
    }
Example #2
0
 //----------------------------------------------------------
 void OnMouseDown()
 {
     if (!gameMenu.activeSelf)
     {
         ButtonSounds Sound = GameObject.Find("UISounds").GetComponent <ButtonSounds>();
         Sound.playButton1();
         gameMenu.SetActive(true);
     }
 }
Example #3
0
 private void Awake()
 {
     if (sounds == null)
     {
         sounds = this;
     }
     else
     {
         DestroyImmediate(this.gameObject);
     }
     DontDestroyOnLoad(this.gameObject);
 }
Example #4
0
 //----------------------------------------------------------
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
     audioSource = GetComponent <AudioSource> ();
 }
 void Awake( )
 {
   #if !(UNITY_FLASH)
     useGUILayout = false;
   #endif
     ExposedVariables.Awake( );
     ExposedVariables.SetParent(this.gameObject);
     if ("1.CMR" != uScript_MasterComponent.Version)
     {
         uScriptDebug.Log("The generated code is not compatible with your current uScript Runtime " + uScript_MasterComponent.Version, uScriptDebug.Type.Error);
         ExposedVariables = null;
         UnityEngine.Debug.Break();
     }
 }
Example #6
0
    public void SelectButton()
    {
        if (firstSelected && !lastSelectedGO)
        {
            lastSelectedGO = firstSelected.gameObject;
        }

        if (lastSelectedGO)
        {
            ButtonSounds bs = lastSelectedGO.GetComponent <ButtonSounds>();
            if (bs)
            {
                bs.isIgnoreNextEnter = true;
            }

            TemplateGameManager.Instance.uiinput.SetSelectedButton(lastSelectedGO);
        }
    }
    void Awake()
    {
        ButtonMusic.GetComponent <Toggle>().onValueChanged.RemoveAllListeners();
        ButtonMusic.GetComponent <Toggle>().onValueChanged.AddListener((bool on) => {
            ButtonMusic.GetComponent <Image>().sprite = on ? SpriteOn : SpriteOff;
            SoundManager.EnableMusic(on);
        });
        ButtonMusic.GetComponent <Toggle>().isOn = SoundManager.IsMusicEnabled();

        ButtonSounds.GetComponent <Toggle>().onValueChanged.RemoveAllListeners();
        ButtonSounds.GetComponent <Toggle>().onValueChanged.AddListener((bool on) => {
            ButtonSounds.GetComponent <Image>().sprite = on ? SpriteOn : SpriteOff;
            SoundManager.EnableSounds(on);
        });
        ButtonSounds.GetComponent <Toggle>().isOn = SoundManager.AreSoundsEnabled();



        ButtonVibrations.SetActive(false);
        TextVibrations.SetActive(false);
        ButtonVibrations.GetComponent <Toggle>().onValueChanged.RemoveAllListeners();
        ButtonVibrations.GetComponent <Toggle>().onValueChanged.AddListener((bool on) => { ButtonVibrations.GetComponent <Image>().sprite = on ? SpriteOn : SpriteOff; });
    }
Example #8
0
 public void PlayButtonSound(ButtonSounds sound)
 {
     _gameManager.SoundManager.PlayButtonSound(sound);
 }