EngediKimHyeYoung / Unity

0 stars 0 forks source link

동영상 사운드 제어 #10

Open EngediKimHyeYoung opened 2 years ago

EngediKimHyeYoung commented 2 years ago

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Video;

public class SoundButton : MonoBehaviour { private bool soundOn = true; public VideoPlayer myMovie; private void OnMouseDown() { if (soundOn) { Debug.Log("사운드 끄기"); soundOn = false; myMovie.SetDirectAudioMute(0, true); myMovie.SetDirectAudioMute(1, true); } else { Debug.Log("사운드 켜기"); soundOn = true; myMovie.SetDirectAudioMute(0, false); myMovie.SetDirectAudioMute(1, false); } } // Start is called before the first frame update void Start() {

}

// Update is called once per frame
void Update()
{

}

}