Esempio n. 1
0
 public bool Encode(out byte[] buffer)
 {
     try
     {
         ApolloBufferWriter writer = new ApolloBufferWriter();
         this.BeforeEncode(writer);
         this.WriteTo(writer);
         buffer = writer.GetBufferData();
         return(true);
     }
     catch (Exception exception)
     {
         buffer = null;
         ADebug.LogException(exception);
         return(false);
     }
 }
Esempio n. 2
0
        public bool Encode(out byte[] buffer)
        {
            bool result;

            try
            {
                ApolloBufferWriter apolloBufferWriter = new ApolloBufferWriter();
                this.BeforeEncode(apolloBufferWriter);
                this.WriteTo(apolloBufferWriter);
                buffer = apolloBufferWriter.GetBufferData();
                result = true;
            }
            catch (Exception exception)
            {
                buffer = null;
                ADebug.LogException(exception);
                result = false;
            }
            return(result);
        }