本文整理汇总了C#中UnityEngine.AudioSource.GetCustomCurve方法的典型用法代码示例。如果您正苦于以下问题:C# AudioSource.GetCustomCurve方法的具体用法?C# AudioSource.GetCustomCurve怎么用?C# AudioSource.GetCustomCurve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.AudioSource
的用法示例。
在下文中一共展示了AudioSource.GetCustomCurve方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Copy
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));
}
}
示例2: TransferFromAudioSource
//Transfers audio settings from an AudioSource. Only used in the editor
public void TransferFromAudioSource(AudioSource source)
{
Loop = source.loop;
Volume = source.volume;
AudioClip = source.clip;
BypassEffects = source.bypassEffects;
BypassListenerEffects = source.bypassListenerEffects;
BypassReverbZones = source.bypassReverbZones;
DopplerLevel = source.dopplerLevel;
MaxDistance = source.maxDistance;
MinDistance = source.minDistance;
Mute = source.mute;
OutputAudioMixerGroup = source.outputAudioMixerGroup;
PanStereo = source.panStereo;
Pitch = source.pitch;
Priority = source.priority;
RolloffMode = source.rolloffMode;
SpatialBlend = source.spatialBlend;
ReverbZoneMix = source.reverbZoneMix;
Spatialize = source.spatialize;
if(RolloffMode == AudioRolloffMode.Custom)
{
CustomRolloffCurve = source.GetCustomCurve(AudioSourceCurveType.CustomRolloff);
}
else
{
CustomRolloffCurve = null;
}
}