コード例 #1
0
        public DNASingleEditor(UMADnaBase dna)
        {
            var fields = dna.GetType().GetFields();

            foreach (FieldInfo field in fields)
            {
                if (field.FieldType != typeof(float))
                {
                    continue;
                }

                string fieldName;
                string groupName;
                GetNamesFromField(field, out fieldName, out groupName);

                DNAGroupEditor group;
                _groups.TryGetValue(groupName, out @group);

                if (group == null)
                {
                    @group = new DNAGroupEditor(groupName);
                    _groups.Add(groupName, @group);
                }

                var entry = new DNAFieldEditor(fieldName, field, dna);

                @group.Add(entry);
            }

            foreach (var group in _groups.Values)
            {
                @group.Sort();
            }
        }
コード例 #2
0
 public void Add(DNAFieldEditor field)
 {
     _fields.Add(field);
 }