()
| 50 | } |
| 51 | |
| 52 | export function createPrefabRegistry(): PrefabRegistry { |
| 53 | const byId = new Map<string, PrefabData>(); |
| 54 | return { |
| 55 | byId: byId, |
| 56 | getPrefab: function(id: string): PrefabData | null { |
| 57 | const found = byId.get(id); |
| 58 | return found ? found : null; |
| 59 | }, |
| 60 | }; |
| 61 | } |
| 62 | |
| 63 | // Register a prefab in the registry. Overwrites any existing entry with the |
| 64 | // same id (hot-reload friendly). |