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));
            }
        }
示例#2
0
        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));
        }
示例#3
0
 public override void Assemble(object obj, IAssignableMemberInfo member, ValueModel model, Type expectedType, AssemblyContext context)
 {
     member.SetValue(obj, _assembler.Assemble(model, expectedType, context));
 }