Exemplo n.º 1
0
        //音量を下げる(0 まで)
        public void VolumeDown()
        {
            int vol = -1;

#if UNITY_EDITOR
            vol = Mathf.Clamp(--debugVolume, 0, maxVolume);  //デバッグ用値
#elif UNITY_ANDROID
            vol = AndroidPlugin.AddMediaVolume(-1, showUI);  //音量-1
#endif
            if (OnVolumeCalled != null)
            {
                OnVolumeCalled.Invoke(vol);
            }
        }
        //Increase volume (limit: maxVolume)
        public void VolumeUp()
        {
            int vol = -1;

#if UNITY_EDITOR
            vol = Mathf.Clamp(++debugVolume, 0, maxVolume); //For debug (Editor only)
#elif UNITY_ANDROID
            vol = AndroidPlugin.AddMediaVolume(1, showUI);  //current volume + 1
#endif
            if (OnVolumeCalled != null)
            {
                OnVolumeCalled.Invoke(vol);
            }
        }