Type to Prefab Mappings in Game Data Manager
Last updated
Last updated
When loading instantiated objects, we only have details about their type and saveFields. Given this information, we can't instantiate the corresponding prefab for that type. To address this, we can establish a relationship between Types and Prefabs in the TypeRegistry, allowing us to read the Type and instantiate the associated Prefab. GameDataManager stores TypeToPrefab Mappings, so you can assign a Prefab to each type that needs to be instantiated.
To optimize performance and minimize overhead, include only necessary types in the Type-to-Prefab mapping. Avoid references that are unnecessary or unused.