コード例 #1
0
        public override bool Equals(object obj)
        {
            if (!(obj is AudioSourceProperties))
            {
                return(false);
            }

            AudioSourceProperties other = (AudioSourceProperties)obj;

            return
                (other.bypassEffects == bypassEffects &&
                 other.bypassListenerEffects == bypassListenerEffects &&
                 other.bypassReverbZones == bypassReverbZones &&
                 other.clip == clip &&
                 other.dopplerLevel == dopplerLevel &&
                 other.enabled == enabled &&
                 other.ignoreListenerPause == ignoreListenerPause &&
                 other.ignoreListenerVolume == ignoreListenerVolume &&
                 other.loop == loop &&
                 other.maxDistance == maxDistance &&
                 other.minDistance == minDistance &&
                 other.mute == mute &&
                 other.outputAudioMixerGroup == outputAudioMixerGroup &&
                 other.panStereo == panStereo &&
                 other.pitch == pitch &&
                 other.priority == priority &&
                 other.reverbZoneMix == reverbZoneMix &&
                 other.rolloffMode == rolloffMode &&
                 other.spatialBlend == spatialBlend &&
                 other.spatialize == spatialize &&
                 other.spatializePostEffects == spatializePostEffects &&
                 other.spread == spread &&
                 other.velocityUpdateMode == velocityUpdateMode);
        }
コード例 #2
0
        protected override ChangeType CalculateDeltaChanges()
        {
            ChangeType changeType = ChangeType.None;
            bool       isPlaying  = audioSource.isPlaying;

            if (isPlaying != this.previousIsPlaying)
            {
                previousIsPlaying = isPlaying;
                if (isPlaying)
                {
                    changeType = ChangeType.PlayStarted;
                }
                else
                {
                    changeType = ChangeType.PlayStopped;
                }
            }

            if (isPlaying)
            {
                AudioSourceProperties currentProperties = new AudioSourceProperties(this.audioSource);
                if (previousProperties != currentProperties)
                {
                    changeType        |= ChangeType.Properties;
                    previousProperties = currentProperties;
                }

                float newVolume = audioSource.volume;
                if (this.previousVolume != newVolume)
                {
                    changeType         |= ChangeType.Volume;
                    this.previousVolume = newVolume;
                }
            }

            return(changeType);
        }