// Set the audio mute status for the specified track. public void SetAudioMute(ushort track, bool mute) { if (mute) { mediaPlayer.SetVolume(0); } else { mediaPlayer.SetVolume(volume); } }
public void OnPointerDown(PointerEventData eventData) { Debug.Log("OnPointerDown:" + m_srcSlider.value); //更新进度条位置 if (m_GazeOver) { m_srcVideo.SetVolume(m_srcSlider.value); } //隐藏圈圈 m_SelectionRadial.HandleUp(); m_SelectionRadial.Hide(); m_GazeOver = false; }
static public bool LoadVideoCache(string fileName) { GameObject tmpObj = new GameObject(); MonoBehaviour.DontDestroyOnLoad(tmpObj); MediaPlayerCtrl tmpCtrl = tmpObj.AddComponent <MediaPlayerCtrl>(); tmpCtrl.Load(fileName); if (tmpCtrl != null) { tmpCtrl.SetVolume(0f); _videoCache[fileName] = tmpObj as GameObject; return(true); } else { UnityEngine.Object.Destroy(tmpObj); Debug.Log("File not found : " + fileName); return(false); } }
public void PlayMovie() { if (GUIMenu.shared() != null) { GUIMenu.shared().isAccessible = false; } movie.Play(); movie.SetVolume(GameDataManager.shared().CONFIG_Volume / 100.0f * audioVolume); StartCoroutine(FadeAlpha()); movie.OnEnd += MovieFinish; MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().setInputEnable(false); MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().stopMoving(); if (OnMovieStart != null) { OnMovieStart(); } }
protected override void LerpStepValue(float value) { controlsToModify.SetVolume(value);; }
public void PlayVideo(string videoPath, RawImage destRawImage, Action onStartAction, Action onEndAction, bool isLoop = false, bool isPauseOnFirstFrame = false, bool stopOnClick = false, SizeMode sm = SizeMode.CG) { if (string.IsNullOrEmpty(videoPath)) { return; } if (IsPlaying) { StopVideo(); } if (destRawImage == null) { if (_DefaluImgVideoRoot == null || _DefaluImgVideo == null) { return; } if (!_DefaluImgVideoRoot.activeSelf) { _DefaluImgVideoRoot.SetActive(true); } _MediaCtrl.m_TargetMaterial[0] = _DefaluImgVideo; } else { if (_DefaluImgVideoRoot != null && _DefaluImgVideoRoot.activeSelf) { _DefaluImgVideoRoot.SetActive(false); } if (_DefaluImgVideo != null) { RawImage rawImage = _DefaluImgVideo.GetComponent <RawImage>(); if (rawImage != null) { rawImage.texture = null; } } _MediaCtrl.m_TargetMaterial[0] = destRawImage.gameObject; } _OnStartCallback = onStartAction; _OnEndCallback = onEndAction; _StopOnClick = stopOnClick; _IsPauseOnFirstFrame = isPauseOnFirstFrame; _VideoName = ProcessVideoPath(videoPath); _IsLoop = isLoop; float fVolume = 0.5f; if (EntryPoint.Instance.GamePersistentConfigParams.ReadFromFile()) { fVolume = EntryPoint.Instance.GamePersistentConfigParams.BGMVolume; } _MediaCtrl.SetVolume(fVolume); PreprareRawImage(_MediaCtrl.m_TargetMaterial[0]); this.enabled = true; }
public override void SetVolume(float volume) { player.SetVolume(volume); }