コード例 #1
0
        /// <summary>
        /// [iOS] Maps to `AL_GAIN`. It is a scalar amplitude multiplier, so the value can go over 1.0 for increasing volume but can be clipped.
        /// If you put 0.5f, it is attenuated by 6 dB.
        ///
        /// [Android] Maps to `SLVolumeItf` interface -> `SetVolumeLevel`.
        /// The floating volume parameter will be converted to millibel (20xlog10x100) so that putting 0.5f here results in 6dB attenuation.
        /// </summary>
        public void SetVolume(float volume)
        {
#if UNITY_IOS
            NativeAudio._SetVolume(InstanceIndex, volume);
#elif UNITY_ANDROID
            NativeAudio.setVolume(InstanceIndex, volume);
#endif
        }