12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System;
- using RenderHeads.Media.AVProVideo;
- using UnityEngine;
- public class VolumeUpdater : MonoBehaviour
- {
- private MediaPlayer mediaPlayer
- {
- get
- {
- if (this.m_MediaPlayer == null)
- {
- this.m_MediaPlayer = base.GetComponent<MediaPlayer>();
- }
- return this.m_MediaPlayer;
- }
- }
- private void Update()
- {
- if (!this.m_MediaPlayer)
- {
- return;
- }
- if (!GameMain.Instance)
- {
- return;
- }
- if (!GameMain.Instance.SoundMgr)
- {
- return;
- }
- int num = GameMain.Instance.SoundMgr.GetVolume(AudioSourceMgr.Type.Bgm);
- num *= GameMain.Instance.SoundMgr.GetVolumeAll();
- this.mediaPlayer.Control.SetVolume((float)num * 0.0001f);
- }
- [SerializeField]
- private MediaPlayer m_MediaPlayer;
- }
|