public override void Assemble(object obj, IAssignableMemberInfo member, ValueModel model, Type expectedType, AssemblyContext context) { if (!ValueModel.IsNull(model)) { if (model is PathModel pathModel) { UnityEngine.Object value = (UnityEngine.Object)SerializationFileAccess.LoadObjectFromFile(pathModel.Path, expectedType); member.SetValue(obj, value); return; } throw new InvalidOperationException(nameof(model) + " must be a " + nameof(PathModel)); } }
public override void Assemble(object obj, IAssignableMemberInfo member, ValueModel model, Type expectedType, AssemblyContext context) { ReferenceModel reference = model as ReferenceModel; context.RequestReference(reference.ReferenceId, x => member.SetValue(obj, x)); }
public override void Assemble(object obj, IAssignableMemberInfo member, ValueModel model, Type expectedType, AssemblyContext context) { member.SetValue(obj, _assembler.Assemble(model, expectedType, context)); }