Beispiel #1
0
 static ScriptVariable()
 {
     Null = new ScriptVariable()
     {
         fieldType = "",
         key       = "",
         value     = null,
     };
 }
Beispiel #2
0
        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);
            }
        }