当前位置: 首页>>代码示例>>C#>>正文


C# AudioSource.GetCustomCurve方法代码示例

本文整理汇总了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));
            }
        }
开发者ID:Magicolo,项目名称:No-Love-No-Gain,代码行数:35,代码来源:AudioSourceExtensions.cs

示例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;
            }
        }
开发者ID:pacificIT,项目名称:UberAudio,代码行数:31,代码来源:AudioManager.cs


注:本文中的UnityEngine.AudioSource.GetCustomCurve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。