Ejemplo n.º 1
0
 public static bool TryReadFrom(byte[] data, ref int index, out SixtyfourByteOscData value)
 {
     if (index + byteCount > data.Length)
     {
         value = new SixtyfourByteOscData();
         return(false);
     }
     value = new SixtyfourByteOscData(
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++],
         data[index++], data[index++], data[index++], data[index++]
         );
     return(true);
 }
        public static bool TryReadFrom(byte[] data, ref int index, out Matrix4x4 value)
        {
            // Try to get blob byte count.
            int byteCountPrefixValue;

            if (!TryReadAndEvaluateByteCountPrefix(data, index, out byteCountPrefixValue))
            {
                value = Matrix4x4.identity;
                return(false);
            }
            index += FourByteOscData.byteCount;

            SixtyfourByteOscData valueData;

            if (!SixtyfourByteOscData.TryReadFrom(data, ref index, out valueData))
            {
                value = Matrix4x4.identity;
                return(false);
            }
            value = valueData.matrix4x4Value;
            return(true);
        }