Esempio n. 1
0
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            if (IsReadOutputAudioMixerGroup(stream.Version))
            {
                OutputAudioMixerGroup.Read(stream);
            }
            AudioClip.Read(stream);
            PlayOnAwake = stream.ReadBoolean();
            if (IsAlignAwake(stream.Version))
            {
                stream.AlignStream(AlignType.Align4);
            }

            Volume = stream.ReadSingle();
            if (IsReadMinVolume(stream.Version))
            {
                MinVolume = stream.ReadSingle();
                MaxVolume = stream.ReadSingle();
            }
            if (IsReadPitch(stream.Version))
            {
                Pitch = stream.ReadSingle();
            }
            Loop = stream.ReadBoolean();
            if (IsReadRolloffFactor(stream.Version))
            {
                RolloffFactor = stream.ReadSingle();
            }
            if (IsReadMute(stream.Version))
            {
                Mute = stream.ReadBoolean();
            }
            if (IsReadSpatialize(stream.Version))
            {
                Spatialize = stream.ReadBoolean();
            }
            if (IsReadSpatializePostEffects(stream.Version))
            {
                SpatializePostEffects = stream.ReadBoolean();
            }
            if (IsAlignMute(stream.Version))
            {
                stream.AlignStream(AlignType.Align4);
            }

            if (IsReadPriority(stream.Version))
            {
                Priority      = stream.ReadInt32();
                DopplerLevel  = stream.ReadSingle();
                MinDistance   = stream.ReadSingle();
                MaxDistance   = stream.ReadSingle();
                Pan2D         = stream.ReadSingle();
                RolloffMode   = (AudioRolloffMode)stream.ReadInt32();
                BypassEffects = stream.ReadBoolean();
            }
            if (IsReadBypassListenerEffects(stream.Version))
            {
                BypassListenerEffects = stream.ReadBoolean();
                BypassReverbZones     = stream.ReadBoolean();
            }
            if (IsAlignBypass(stream.Version))
            {
                stream.AlignStream(AlignType.Align4);
            }

            if (IsReadRolloffCustomCurve(stream.Version))
            {
                RolloffCustomCurve.Read(stream);
                PanLevelCustomCurve.Read(stream);
                SpreadCustomCurve.Read(stream);
            }
            if (IsReadReverbZoneMixCustomCurve(stream.Version))
            {
                ReverbZoneMixCustomCurve.Read(stream);
            }
        }
Esempio n. 2
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            if (HasOutputAudioMixerGroup(reader.Version))
            {
                OutputAudioMixerGroup.Read(reader);
            }
            AudioClip.Read(reader);
            PlayOnAwake = reader.ReadBoolean();
            if (IsAlignAwake(reader.Version))
            {
                reader.AlignStream();
            }

            Volume = reader.ReadSingle();
            if (HasMinVolume(reader.Version))
            {
                MinVolume = reader.ReadSingle();
                MaxVolume = reader.ReadSingle();
            }
            if (HasPitch(reader.Version))
            {
                Pitch = reader.ReadSingle();
            }
            Loop = reader.ReadBoolean();
            if (HasRolloffFactor(reader.Version))
            {
                RolloffFactor = reader.ReadSingle();
            }
            if (HasMute(reader.Version))
            {
                Mute = reader.ReadBoolean();
            }
            if (HasSpatialize(reader.Version))
            {
                Spatialize = reader.ReadBoolean();
            }
            if (HasSpatializePostEffects(reader.Version))
            {
                SpatializePostEffects = reader.ReadBoolean();
            }
            if (IsAlignMute(reader.Version))
            {
                reader.AlignStream();
            }

            if (HasPriority(reader.Version))
            {
                Priority      = reader.ReadInt32();
                DopplerLevel  = reader.ReadSingle();
                MinDistance   = reader.ReadSingle();
                MaxDistance   = reader.ReadSingle();
                Pan2D         = reader.ReadSingle();
                RolloffMode   = (AudioRolloffMode)reader.ReadInt32();
                BypassEffects = reader.ReadBoolean();
            }
            if (HasBypassListenerEffects(reader.Version))
            {
                BypassListenerEffects = reader.ReadBoolean();
                BypassReverbZones     = reader.ReadBoolean();
            }
            if (IsAlignBypass(reader.Version))
            {
                reader.AlignStream();
            }

            if (HasRolloffCustomCurve(reader.Version))
            {
                RolloffCustomCurve.Read(reader);
                PanLevelCustomCurve.Read(reader);
                SpreadCustomCurve.Read(reader);
            }
            if (HasReverbZoneMixCustomCurve(reader.Version))
            {
                ReverbZoneMixCustomCurve.Read(reader);
            }
        }