//Plays a one shot of sound effects
    public void PlayButtonSound(ButtonEffects buttonFX)
    {
        switch (buttonFX)
        {
        case ButtonEffects.SFXBUTTONONE:
            m_SoundEffectSource.PlayOneShot(m_ButtonOne);
            break;

        case ButtonEffects.SFXBUTTONTWO:
            m_SoundEffectSource.PlayOneShot(m_ButtonTwo);
            break;


        case ButtonEffects.SFXBUTTONTHREE:
            m_SoundEffectSource.PlayOneShot(m_ButtonThree);
            break;

        case ButtonEffects.SFXBUTTONFOUR:
            m_SoundEffectSource.PlayOneShot(m_ButtonFour);
            break;

        default:
            Debug.Log("BUTTON: NOT PLAYING");
            break;
        }
    }
Example #2
0
    private void UpdateSoundBtnUI()
    {
        bool on = sm.WorldVolume.GetFactor(volume_id) == 1;

        bool arrows = ButtonEffects.HasArrows(sound_text.text);

        sound_text.text = "Sound " + (on ? "On" : "Off");
        if (arrows)
        {
            sound_text.text = ButtonEffects.AddArrows(sound_text.text);
        }
    }
Example #3
0
    private void UpdateMusicBtnUI()
    {
        bool on = sm.MusicVolume.GetFactor(volume_id) == 1;

        bool arrows = ButtonEffects.HasArrows(music_text.text);

        music_text.text = "Music " + (on ? "On" : "Off");
        if (arrows)
        {
            music_text.text = ButtonEffects.AddArrows(music_text.text);
        }
    }
Example #4
0
            public Button()
            {
                //printer = new TextPrinter(TextQuality.Default);
                TextFont = TextPrinter.DefaultFont;
                this.ForegroundColor = Color.Black;
                this.BackgroundColor = Color.LightGray;

                this.SecondaryForegroundColor = Color.Black;
                this.SecondaryBackgroundColor = Color.LightGray;

                ButtonEffect = new ButtonEffects(this);
                ButtonEffect.OverShadow = false;
                ButtonEffect.BorderEffect = false;

                //this.Image = new Graphics.Texture("data/new.bmp", TextureMinFilter.Linear, TextureMagFilter.Linear);
                //this.SecondaryImage;
            }
Example #5
0
 void ChangeButtonUI(ButtonEffects effect)
 {
     effect.ChangeButtonUI(gameObject);
 }
    //Plays a one shot of sound effects
    public void PlayButtonSound(ButtonEffects buttonFX)
    {
        switch (buttonFX)
        {
            case ButtonEffects.SFXBUTTONONE:
                m_SoundEffectSource.PlayOneShot(m_ButtonOne);
                break;

            case ButtonEffects.SFXBUTTONTWO:
                m_SoundEffectSource.PlayOneShot(m_ButtonTwo);
                break;


            case ButtonEffects.SFXBUTTONTHREE:
                m_SoundEffectSource.PlayOneShot(m_ButtonThree);
                break;

            case ButtonEffects.SFXBUTTONFOUR:
                m_SoundEffectSource.PlayOneShot(m_ButtonFour);
                break;

            default:
                Debug.Log("BUTTON: NOT PLAYING");
                break;
        }
    }
Example #7
0
 // Start is called before the first frame update
 void Awake()
 {
     player        = GameObject.FindObjectOfType <Player>();
     buttonEffects = GameObject.FindObjectOfType <ButtonEffects>();
 }