private void updateSimpleProperty(string entire_name, string st, Type gOType, object obj)
        {
            MemberInfo[] members = gOType.GetMember(st, BindingAttr);
            //Debug.Log("update "+entire_name+" members length"+ members.Length+" st "+st+" type "+gOType);
            if (members.Length == 0)
            {
                return;
            }
            FieldOrProperty property = new FieldOrProperty(members[0]);

            //Debug.Log(property.Type()+" contained: "+ dictionaryPerType.ContainsKey(property.Type()));
            if (dictionaryPerType.ContainsKey(property.Type()))
            {
                Type propertyInDictionaryType = dictionaryPerType[property.Type()].GetType().GetGenericArguments()[1];
                property.SetValue(obj, Convert.ChangeType(dictionaryPerType[property.Type()][entire_name], property.Type()));
                //Debug.Log("sat value " + property.GetValue(obj));
            }

            //Debug.Log("added " + st + "with value " + ((IList)dictionaryPerType[property.Type()][st])[((IList)dictionaryPerType[property.Type()][st]).Count - 1]);
        }
Ejemplo n.º 2
0
 public override void Do()
 {
     field.SetValue(obj, newData);
 }