How to save changes that made in inspector

9273807--1298658--upload_2023-9-5_16-47-0.png

[System.Serializable]
public struct AttiributeList
{
public string Attiribute;
public short Value;

}
public AttiributeList[ ] attiributeList;

whenever ı make new enemy ı have to create new elements of list and and give them name because script resets, but ı want to set their value only the rest can stay same. how can ı save inspector saves ? or can I adjust members of list in scripts ? their name dont need to be even public just [SerializeField] will be nice if ı can adjust it in scripts.

These fields should be saved when you change them in the Inspector and save the scene or prefab. If they don’t “save” we need to see more of the script. Perhaps you are not considering somewhere that AttiributeList is a value-type. For example, this will NOT update the value in the list:

var att = attiributeList[0];
att.Value = -100;

If you do that, this needs to be followed by an assignment since the above only modified a copy of the struct:

attiributeList[0] = att;

It’s the same as when modifiying transform.position for example. You always need to reassign the position because Vector3 is a value type.

If you want to copy these fields of the component, use the three-vertical-dots menu in the upper right corner of the component (here named: “Attributes Sc”).

Try saving as a preset.

Then you can load the preset and change it.

You are a hero I am really grateful, it is totally what I need also I learned new thing.
It ıs not releated but I want to ask something, maybe you know. I had a post but did get answer.
Whenever ı do someting about prefabs I get memory leak warming even for empty game objects without anyting.