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(); } }
private void EmitDeserializeOfIUnitySerializableItem(FieldReference fieldDef, TypeReference elementTypeRef) { if (MethodEmitterBase.IsStruct(elementTypeRef)) { this.EmitDeserializeOfStructItem(fieldDef, elementTypeRef); } else { this.EmitDeserializeOfIUnitySerializableClassItem(fieldDef, elementTypeRef); } }
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); } }