static ScriptVariable() { Null = new ScriptVariable() { fieldType = "", key = "", value = null, }; }
public override void Initialize <T1>(T1 comp, INodeTable <string> containerTable) { base.Initialize(comp, containerTable); this.BehaviourName = comp.GetType().ToString(); var type = Value.GetType(); var fieldInfos = from info in type.GetFields() where info.IsPublic select info; foreach (var field in fieldInfos) { var key = field.Name; var val = field.GetValue(Value); var fieldType = GetFieldTypeFromObject(val); var kv = new ScriptVariable() { fieldType = fieldType, key = key, value = val, }; variables.Add(kv); } }