Ejemplo n.º 1
0
        private void ReadVuMarkCode(XmlReader configReader, ref InstanceIdType idType, ref int idLength)
        {
            string attribute = configReader.GetAttribute("IDtype");

            if (!(attribute == "numeric"))
            {
                if (!(attribute == "bytes"))
                {
                    if (!(attribute == "string"))
                    {
                        Debug.LogWarning("Info parser: invalid VuMark ID Type");
                    }
                    else
                    {
                        idType = InstanceIdType.STRING;
                    }
                }
                else
                {
                    idType = InstanceIdType.BYTES;
                }
            }
            else
            {
                idType = InstanceIdType.NUMERIC;
            }
            if (!int.TryParse(configReader.GetAttribute("IDlength"), out idLength) && idType == InstanceIdType.STRING)
            {
                Debug.LogWarning("Info parser: invalid VuMark ID Length");
            }
        }
Ejemplo n.º 2
0
 public InstanceIdImpl(byte[] buffer, ulong numericValue, InstanceIdType dataType, uint dataLength)
 {
     this.mBuffer            = buffer;
     this.mDataType          = dataType;
     this.mDataLength        = dataLength;
     this.mNumericValue      = numericValue;
     this.mCachedStringValue = "";
     if (this.mDataType == InstanceIdType.STRING)
     {
         byte[] array = new byte[this.mBuffer.Length];
         Array.Copy(this.mBuffer, array, this.mBuffer.Length);
         Array.Reverse(array);
         this.mCachedStringValue = Encoding.ASCII.GetString(buffer);
     }
 }
 public VuMarkTargetImpl(int id, byte[] buffer, ulong numericValue, InstanceIdType dataType, uint dataLength, VuMarkTemplateImpl template)
 {
     this.mTargetId       = id;
     this.mVuMarkTemplate = template;
     this.mInstanceId     = new InstanceIdImpl(buffer, numericValue, dataType, dataLength);
 }