Search Unity

Hey Guys Can U Help Me?

Discussion in 'Scripting' started by PhantomXDemon19, Apr 19, 2021.

  1. PhantomXDemon19

    PhantomXDemon19

    Joined:
    Apr 19, 2021
    Posts:
    1
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;

    public class LogicaVolumen : MonoBehaviour
    {
    public Slider slider;
    public float sliderValue;
    Public Image imageMute;
    // Start is called before the first frame update
    void Start()
    {
    slider.value = PlayerPrefs.GetFloat ("VolumenAudio", 50f);
    AudioListener.volume = slider.value;
    RevisarSiEstoyMute();
    }

    public void ChangeSlider(float valor)
    {
    slider.value = valor;
    PlayerPrefs.SetFloat("VolumenAudio", sliderValue);
    AudioListener.volume = slider.value;
    RevisarSiEstoyMute();
    }

    public void RevisarSiEstoyMute();
    {
    if (sliderValue == 0)
    {
    imageMute.enabled = true;
    }
    else
    {
    imageMute.enabled = false;
    }
    }
    }
     
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,188
    Use code tags
    And help you what? We really can't read your mind. If you have an error, copy and paste the error. If something isn't working right, tell us what you are trying to do and what is going wrong.
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    JoNax97 and Brathnann like this.
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Help with what?