Gablarski.Messages.SourceListMessage.ReadPayload C# (CSharp) Method

ReadPayload() public method

public ReadPayload ( ISerializationContext context, IValueReader reader ) : void
context ISerializationContext
reader IValueReader
return void
        public override void ReadPayload(ISerializationContext context, IValueReader reader)
        {
            AudioSource[] sourceInfos = new AudioSource[reader.ReadInt32()];
            for (int i = 0; i < sourceInfos.Length; ++i)
                sourceInfos[i] = new AudioSource (context, reader);

            this.Sources = sourceInfos;
        }

Usage Example

Example #1
0
        public void EmptySourceList()
        {
            var msg = new SourceListMessage (new List<AudioSource>());
            Assert.AreEqual (0, msg.Sources.Count());
            msg.WritePayload (serverContext, writer);
            long length = stream.Position;
            stream.Position = 0;

            msg = new SourceListMessage();
            msg.ReadPayload (clientContext, reader);
            Assert.AreEqual (length, stream.Position);
            Assert.AreEqual (0, msg.Sources.Count());
        }
All Usage Examples Of Gablarski.Messages.SourceListMessage::ReadPayload