예제 #1
0
        public void SetValue(IList array, int index)
        {
            if (array == null)
            {
                return;
            }

            if (array.Count > index)
            {
                var target = array[index];

                if (target == null)
                {
                    if (isUnityObject)
                    {
                        return;
                    }
                    else
                    {
                        target = array[index] = TypePoolManager.Create(source.GetType());
                    }
                }

                copier.CopyTo(source, target);
            }
        }
예제 #2
0
        public void SetValue(object instance)
        {
            if (instance == null)
            {
                return;
            }

            var target = field.GetValue(instance);

            if (target == null)
            {
                if (isUnityObject)
                {
                    return;
                }
                else
                {
                    field.SetValue(instance, target = TypePoolManager.Create(source.GetType()));
                }
            }

            copier.CopyTo(source, target);
        }
예제 #3
0
 public void InitializeFields(object instance)
 {
     copier.CopyTo(source, instance);
 }