How can we apply prefabs correctly for same objects with same scripts but different fields values?

Hi all
Suppose we have some gameobjects(like panels) that are the same but the serialized fields of their classes are different
If I make different prefabs for every of them, when I need to change the apparancy of the panel (for example uis), I have to change all of the prefabs.
If I make one prefab for all of them then when I change field values in the class , all field values of the game objects are changed

Sorry, didn’t really understand that.

we have many panel objects (they are the same based on apparancy )with CPanel class like below for example:

public class CPanel{
   [SerializeField]
   EEnum m_enum;
   [SerializeField]
    string m_str;
   [SerializeField]
    int m_int;
//...
}

How can we make prefabs. now plz read above again :slight_smile:

What you are looking for are nested prefabs which unity currently doesnt support. There is a package on the unity store for it if you really need it.

A workaround in this case could be to place copies of your existing prefab in the scene, set them up, set them to inactive then duplicate as necessary.

1 Like