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; } } }
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.
"Can U Help Me?" How to report your problem productively in the Unity3D forums: http://plbm.com/?p=220 How to understand compiler and other errors and even fix them yourself: https://forum.unity.com/threads/ass...3-syntax-error-expected.1039702/#post-6730855 If you post a code snippet, ALWAYS USE CODE TAGS: How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/ Also, consider this: