The unhelpful answer is "don't give fields blank names."
However, if you have a field with a blank name, you won't be able to look it up by name. Instead, you'll need to iterate through the fields and find the field with the blank name:
foreach (var field in myItem.fields)
{
if (string.IsNullOrEmpty(field.name))
{
field.name = "a name"; //<-- Probably a good idea to give it a name.
field.value = "a value";
break;
}
}
DialogueDatabase db = Resources.Load<DialogueDatabase>("Dialogo_data/item_database");
var myItem = db.GetItem("Axe of Ice");
var _fields= myItem.fields;
for(int i = 0; i < _fields.Count; i++)
{
if(_fields.title == "Descripcion")
{
_fields.value = "Is a powerfull weapon.";
}
}
DialogueDatabase db = Resources.Load<DialogueDatabase>("Dialogo_data/item_database");
var template = Template.mycustomtemplate(); <<------ i wan to use my custom item template
var item = template.CreateItem(template.GetNextItemID(db), "name");
db.items.Add(item);
EditorUtility.SetDirty(db);