The proper way to save and instantiate game data

Hi there,

Let’s say i have a class named Entity such as:

class Entity
{
  public string name;
  public List<Behavior> behaviors;
  // other stuff...
}

I want to create an editor window that allow game designers to create “instances” of that class by giving the name and a set of Behavior, which are premade classes by devs.
What is the proper way (or one of them) to save what GDs create and use it during runtime?

At first, I was thinking of creating prefabs, but:

  • prefabutility.createprefab is tagged as Obsolete in the doc
  • I don’t know if it’s a good solution in term of memory, maintainability, scalability, …