前提・実現したいこと
サウンド関係をSliderを用いてゲーム内で調整できるようにしたいと思い
AudioMixerと以下のとスクリプトを作成しSliderに付けました。
音量の調整は問題なくできているのですがSliderのHandleをシーンAで変更して
別のシーンに移ってまたシーンAに戻るとHandleが初期位置に戻ってしまっています。
音量変更自体はシーン移動しても維持されているので、Handleの位置も
維持させたいのですがそれはどうすればできますか?
SoundOption.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Audio; using UnityEngine.UI; public class SoundOption : MonoBehaviour { [SerializeField] private AudioMixer audioMixer; public void SetMaster(float volume) { audioMixer.SetFloat("MasterVol", volume); } public void SetBGM(float volume) { audioMixer.SetFloat("BGMVol", volume); } public void SetSE(float volume) { audioMixer.SetFloat("SEVol", volume); } public void SetVOICE(float volume) { audioMixer.SetFloat("VOICEVol", volume); } }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/11 05:11