當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。