// Start is called before the first frame update void Start() { BGMSlider.value = BGMVol; CriAtom.SetCategoryVolume("Music", BGMVol); SESlider.value = SEVol; CriAtom.SetCategoryVolume("SFX", SEVol); }
private void Volume() { if (!isSoundFade) { BGMVolume = BGMSlider.value; SEVolume = SESlider.value; CriAtom.SetCategoryVolume("BGM", BGMVolume / 10); CriAtom.SetCategoryVolume("Jingle", SEVolume / 10); CriAtom.SetCategoryVolume("SE", SEVolume / 10); CriAtom.SetCategoryVolume("wind", SEVolume / 10); } }
// Update is called once per frame void Update() { if (_fadeOut) { _volume -= 0.01f; //BGMのボリュームを段階的に下げる CriAtom.SetCategoryVolume("BGM", _volume); if (_volume == 0.0f) { _volume = 0.0f; } } }
void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { _flagManager.deadZoneCol = true; //カメラのブレンド速度を変化させる _cinemachineBrain.m_DefaultBlend.m_Time = 0.7f; //カメラをぐるりんに近づける vCam.SetActive(true); NeoConfig.isSoundFade = true; CriAtom.SetCategoryVolume("BGM", 0.0f); var _rb2d = other.GetComponent <Rigidbody2D>(); //ぐるりんの動き(操作系・重力系)を停止 _rb2d.constraints = RigidbodyConstraints2D.FreezeAll; //顔を驚き顔に変更 _flagManager.surprise_Face = true; // 残機を減らす RemainingLife.life -= 1; if (RemainingLife.life != 0) { if (_SEPlay == false) { _flagManager.returnGravity = true; _gameOverSE.Play(); _SEPlay = true; } } else if (RemainingLife.life == 0) { _flagManager.returnGravity = true; //残機が0ならGameOverを表示 _gameOver.alpha = 1.0f; //ゲームオーバー時のBGMを鳴らす if (_SEPlay == false) { _gameOverSE.Play(); _SEPlay = true; } } if (deadZone != null) { deadZone.BossSceneReload(); } Invoke("GameOver", 2.0f); } }
private void volumeFade() { if (_volumeDown) { _volumeBGM -= bgmDecay; if (_volumeBGM < 0) { _volumeBGM = 0; } _volumeSE -= seDecay; if (_volumeSE < 0) { _volumeSE = 0; } CriAtom.SetCategoryVolume("BGM", _volumeBGM); CriAtom.SetCategoryVolume("SE", _volumeSE); } }
// Update is called once per frame void Update() { if (_volumeDown) { //ゴール時にボリュームをマイナスする(フェードアウト) //_volume -= 0.01f; //BGMカテゴリとSEカテゴリを指定 _volumeBGM -= bgmDecay; if (_volumeBGM < 0) { _volumeBGM = 0; } _volumeSE -= seDecay; if (_volumeSE < 0) { _volumeSE = 0; } CriAtom.SetCategoryVolume("BGM", _volumeBGM); CriAtom.SetCategoryVolume("SE", _volumeSE); Debug.Log(_volumeBGM); } if (button) { NeoConfig.isSoundFade = false; if (_volumeDown == false) { NeoConfig.isSoundFade = true; _volumeBGM = NeoConfig.BGMVolume / 10f; if (_volumeBGM < 0) { _volumeBGM = 0; } _volumeSE = NeoConfig.SEVolume / 10f; if (_volumeSE < 0) { _volumeSE = 0; } bgmDecay = (NeoConfig.BGMVolume / 10 * Time.deltaTime) / 1f; seDecay = (NeoConfig.SEVolume / 10 * Time.deltaTime) / 1f; _volumeDown = true; Invoke("GameStart", 1.5f); } } }
float m_ScroolSpeed = 1;//キー入力で調整バーを動かすスピード void Awake() { atomSlider = GetComponent <Slider>(); //m_Slider.value = AudioListener.volume; atomSlider.onValueChanged.AddListener((value) => { CriAtom.SetCategoryVolume(BGMCategoryName, value); }); }
void IInitializable.Initialize() { // initialize Observable.EveryUpdate() .Where(_ => CriWareInitializer.IsInitialized()) .First() .SelectMany(_ => ADX2Utility.AddCueSheet(_settings.BuiltInCueSheet) .First()) .Subscribe(cueSheet => { if (cueSheet != null) { // add cue list var cueNameList = ADX2Utility.GetCueNameList(cueSheet.name); foreach (var cueName in cueNameList) { _cueSheetDictionary.Add(cueName, cueSheet.name); } // create sound source var source = new GameObject("BGM").AddComponent <CriAtomSource>(); source.use3dPositioning = false; source.loop = true; source.player.AttachFader(); _source.Value = source; } _initialized.Value = true; }) .AddTo(_disposable); Observable.Merge( _intent.OnPlayAsObservable().Select(x => x.ToString()), _intent.OnPlayForNameAsObservable()) .Where(_ => _initialized.Value) .Subscribe(x => { string cueSheet; if (!_cueSheetDictionary.TryGetValue(x, out cueSheet)) { Debug.unityLogger.LogError(GetType().Name, $"{x} is not found."); return; } _source.Value.cueSheet = cueSheet; _source.Value.Pause(false); _source.Value.Play(x); }) .AddTo(_disposable); _intent.OnPauseAsObservable() .Where(_ => _source.Value != null) .Subscribe(x => _source.Value.Pause(x)) .AddTo(_disposable); _intent.OnStopAsObservable() .Where(_ => _source.Value != null) .Subscribe(_ => _source.Value.Stop()) .AddTo(_disposable); // volume _volumeIntent.OnMasterVolumeAsObservable() .Subscribe(x => _masterVolume.Value = x) .AddTo(_disposable); _volumeIntent.OnVoiceVolumeAsObservable() .Subscribe(x => _volume.Value = x) .AddTo(_disposable); var initialize = _initialized .Where(x => x) .First() .Publish() .RefCount(); initialize .Where(_ => _source.Value != null) .SelectMany(_ => _masterVolume) .Subscribe(x => _source.Value.volume = x) .AddTo(_disposable); initialize .SelectMany(_ => _volume) .Subscribe(x => CriAtom.SetCategoryVolume(_settings.CategoryVolumeName, x)) .AddTo(_disposable); }
public void Initialize() { CriAtom.SetCategoryVolume("BGM", Bgm); CriAtom.SetCategoryVolume("SE", Se); CriAtom.SetCategoryVolume("Voice", Voice); }
public void SESet() { SEVol = SESlider.value; CriAtom.SetCategoryVolume("SFX", SEVol); }
public void BGMSet() { BGMVol = BGMSlider.value; CriAtom.SetCategoryVolume("Music", BGMVol); }
// Token: 0x060159D1 RID: 88529 RVA: 0x00580750 File Offset: 0x0057E950 public void SetCategoryVolume(string category, float volume) { CriAtom.SetCategoryVolume(category, volume); }