UnityEngine.AudioSource.GetCustomCurve C# (CSharp) Method

GetCustomCurve() private method

private GetCustomCurve ( AudioSourceCurveType type ) : AnimationCurve
type AudioSourceCurveType
return AnimationCurve
        public extern AnimationCurve GetCustomCurve(AudioSourceCurveType type);
        /// <summary>

Usage Example

コード例 #1
0
        public static void Copy(this AudioSource target, AudioSource source, bool useCustomCurves = true)
        {
            target.enabled = source.enabled;
            target.clip = source.clip;
            target.mute = source.mute;
            target.bypassEffects = source.bypassEffects;
            target.bypassListenerEffects = source.bypassListenerEffects;
            target.bypassReverbZones = source.bypassReverbZones;
            target.playOnAwake = source.playOnAwake;
            target.loop = source.loop;
            target.priority = source.priority;
            target.volume = source.volume;
            target.pitch = source.pitch;
            target.dopplerLevel = source.dopplerLevel;
            target.rolloffMode = source.rolloffMode;
            target.minDistance = source.minDistance;
            target.spatialBlend = source.spatialBlend;
            target.spread = source.spread;
            target.maxDistance = source.maxDistance;
            target.panStereo = source.panStereo;
            target.time = source.time;
            target.timeSamples = source.timeSamples;
            target.velocityUpdateMode = source.velocityUpdateMode;
            target.ignoreListenerPause = source.ignoreListenerPause;
            target.ignoreListenerVolume = source.ignoreListenerVolume;
            target.spatialize = source.spatialize;

            if (useCustomCurves)
            {
                target.SetCustomCurve(AudioSourceCurveType.CustomRolloff, source.GetCustomCurve(AudioSourceCurveType.CustomRolloff));
                target.SetCustomCurve(AudioSourceCurveType.ReverbZoneMix, source.GetCustomCurve(AudioSourceCurveType.ReverbZoneMix));
                target.SetCustomCurve(AudioSourceCurveType.SpatialBlend, source.GetCustomCurve(AudioSourceCurveType.SpatialBlend));
                target.SetCustomCurve(AudioSourceCurveType.Spread, source.GetCustomCurve(AudioSourceCurveType.Spread));
            }
        }
All Usage Examples Of UnityEngine.AudioSource::GetCustomCurve