Exemplo n.º 1
0
        public unsafe static Hash128 ReadHash128(SerializedProperty property)
        {
            var raw = new RawHash128();

            raw.Bytes[0]  = (byte)property.FindPropertyRelative("bytes[0]").intValue;
            raw.Bytes[1]  = (byte)property.FindPropertyRelative("bytes[1]").intValue;
            raw.Bytes[2]  = (byte)property.FindPropertyRelative("bytes[2]").intValue;
            raw.Bytes[3]  = (byte)property.FindPropertyRelative("bytes[3]").intValue;
            raw.Bytes[4]  = (byte)property.FindPropertyRelative("bytes[4]").intValue;
            raw.Bytes[5]  = (byte)property.FindPropertyRelative("bytes[5]").intValue;
            raw.Bytes[6]  = (byte)property.FindPropertyRelative("bytes[6]").intValue;
            raw.Bytes[7]  = (byte)property.FindPropertyRelative("bytes[7]").intValue;
            raw.Bytes[8]  = (byte)property.FindPropertyRelative("bytes[8]").intValue;
            raw.Bytes[9]  = (byte)property.FindPropertyRelative("bytes[9]").intValue;
            raw.Bytes[10] = (byte)property.FindPropertyRelative("bytes[10]").intValue;
            raw.Bytes[11] = (byte)property.FindPropertyRelative("bytes[11]").intValue;
            raw.Bytes[12] = (byte)property.FindPropertyRelative("bytes[12]").intValue;
            raw.Bytes[13] = (byte)property.FindPropertyRelative("bytes[13]").intValue;
            raw.Bytes[14] = (byte)property.FindPropertyRelative("bytes[14]").intValue;
            raw.Bytes[15] = (byte)property.FindPropertyRelative("bytes[15]").intValue;
            return(raw.Hash);
        }
Exemplo n.º 2
0
        public unsafe static void WriteHash128(SerializedProperty property, Hash128 hash)
        {
            var raw = new RawHash128 {
                Hash = hash
            };

            property.FindPropertyRelative("bytes[0]").intValue  = raw.Bytes[0];
            property.FindPropertyRelative("bytes[1]").intValue  = raw.Bytes[1];
            property.FindPropertyRelative("bytes[2]").intValue  = raw.Bytes[2];
            property.FindPropertyRelative("bytes[3]").intValue  = raw.Bytes[3];
            property.FindPropertyRelative("bytes[4]").intValue  = raw.Bytes[4];
            property.FindPropertyRelative("bytes[5]").intValue  = raw.Bytes[5];
            property.FindPropertyRelative("bytes[6]").intValue  = raw.Bytes[6];
            property.FindPropertyRelative("bytes[7]").intValue  = raw.Bytes[7];
            property.FindPropertyRelative("bytes[8]").intValue  = raw.Bytes[8];
            property.FindPropertyRelative("bytes[9]").intValue  = raw.Bytes[9];
            property.FindPropertyRelative("bytes[10]").intValue = raw.Bytes[10];
            property.FindPropertyRelative("bytes[11]").intValue = raw.Bytes[11];
            property.FindPropertyRelative("bytes[12]").intValue = raw.Bytes[12];
            property.FindPropertyRelative("bytes[13]").intValue = raw.Bytes[13];
            property.FindPropertyRelative("bytes[14]").intValue = raw.Bytes[14];
            property.FindPropertyRelative("bytes[15]").intValue = raw.Bytes[15];
        }