Esempio n. 1
0
        protected override void EmitInstructionsFor(FieldReference fieldDef)
        {
            this.CallDeserializationMethod(fieldDef);
            TypeReference typeRef = base.TypeOf(fieldDef);

            if ((!MethodEmitterBase.IsStruct(base.TypeDef) || !UnityEngineTypePredicates.IsUnityEngineValueType(base.TypeDef)) && (MethodEmitterBase.IsStruct(typeRef) || MethodEmitterBase.RequiresAlignment(typeRef)))
            {
                this.EmitAlign();
            }
        }
Esempio n. 2
0
 private void EmitDeserializeOfIUnitySerializableItem(FieldReference fieldDef, TypeReference elementTypeRef)
 {
     if (MethodEmitterBase.IsStruct(elementTypeRef))
     {
         this.EmitDeserializeOfStructItem(fieldDef, elementTypeRef);
     }
     else
     {
         this.EmitDeserializeOfIUnitySerializableClassItem(fieldDef, elementTypeRef);
     }
 }
Esempio n. 3
0
        private void InlinedDeserializeInvocationFor(FieldReference fieldDef)
        {
            TypeReference typeRef = base.TypeOf(fieldDef);

            if (!MethodEmitterBase.IsStruct(typeRef))
            {
                base.EmitWithNullCheckOnField(fieldDef, new Action <FieldReference>(this.ConstructAndStoreSerializableObject));
                base.EmitLoadField(fieldDef);
                this.CallDeserializeMethodFor(fieldDef.Name, typeRef);
            }
            else
            {
                base.EmitLoadField(fieldDef);
                this.CallDeserializeMethodFor(fieldDef.Name, typeRef);
            }
        }