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)); } }
static public int GetCustomCurve(IntPtr l) { try { UnityEngine.AudioSource self = (UnityEngine.AudioSource)checkSelf(l); UnityEngine.AudioSourceCurveType a1; checkEnum(l, 2, out a1); var ret = self.GetCustomCurve(a1); pushValue(l, ret); return(1); } catch (Exception e) { return(error(l, e)); } }
static int GetCustomCurve(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.AudioSource obj = (UnityEngine.AudioSource)ToLua.CheckObject <UnityEngine.AudioSource>(L, 1); UnityEngine.AudioSourceCurveType arg0 = (UnityEngine.AudioSourceCurveType)ToLua.CheckObject(L, 2, TypeTraits <UnityEngine.AudioSourceCurveType> .type); UnityEngine.AnimationCurve o = obj.GetCustomCurve(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetCustomCurve(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.AudioSource obj = (UnityEngine.AudioSource)ToLua.CheckObject(L, 1, typeof(UnityEngine.AudioSource)); UnityEngine.AudioSourceCurveType arg0 = (UnityEngine.AudioSourceCurveType)LuaDLL.luaL_checknumber(L, 2); UnityEngine.AnimationCurve o = obj.GetCustomCurve(arg0); ToLua.PushSealed(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
//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; } }